Commit 034b96bf authored by Jakob Moser's avatar Jakob Moser
Browse files

Re-order exercises per results of our user tests

parent 704c8269
Loading
Loading
Loading
Loading
+22 −22
Original line number Diff line number Diff line
@@ -80,6 +80,16 @@ export const practice = test("Linux-Übungsmodus", function() {
        this.verify("cat satz").hasOutput("Colorless green ideas sleep furiously")
    })

    this.exercise("Inhalt anzeigen", async function () {
        this.describe(`Zeige den Inhalt der Datei "satz" auf der Konsole an.`)

        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; echo Colorless green ideas sleep furiously > satz")

        await this.manualConfirmation()

        this.verify().hasOutput("Colorless green ideas sleep furiously")
    })

    this.exercise("Datei umbenennen", async function () {
        this.describe(`Ändere den Namen der Datei "satz" in "saetze".`)

@@ -100,14 +110,22 @@ export const practice = test("Linux-Übungsmodus", function() {
        this.verify("cat saetze").hasOutput(["Colorless green ideas sleep furiously", "The cat is on the mat"])
    })

    this.exercise("Inhalt anzeigen", async function () {
        this.describe(`Zeige den Inhalt der Datei "saetze" auf der Konsole an.`)
    this.exercise("Berechtigungen anzeigen", async function () {
        this.describe(`Lass dir die aktuellen Berechtigungen für die Datei "saetze" anzeigen.`)

        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; echo Colorless green ideas sleep furiously > saetze; echo The cat is on the mat >> saetze")
        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; echo Colorless green ideas sleep furiously > saetze; echo The cat is on the mat >> saetze; chmod 644 saetze")

        await this.manualConfirmation()

        this.verify().hasOutput(["Colorless green ideas sleep furiously", "The cat is on the mat"])
        this.verify().hasOutput((outputLines) => {
            for(const line of outputLines) {
                if(line.match(/.*-rw-r--r--.*/)) {
                    return true
                }
            }
            
            return false
        })
    })

    this.exercise("Berechtigungen ändern", async function () {
@@ -122,24 +140,6 @@ export const practice = test("Linux-Übungsmodus", function() {
        })
    })

    this.exercise("Berechtigungen anzeigen", async function () {
        this.describe(`Lass dir die aktuellen Berechtigungen für die Datei "saetze" anzeigen.`)

        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; if [[ ! -f saetze ]]; then echo Colorless green ideas sleep furiously > saetze; echo The cat is on the mat >> saetze; fi; chmod 460 saetze")

        await this.manualConfirmation()

        this.verify().hasOutput((outputLines) => {
            for(const line of outputLines) {
                if(line.match(/.*-r--rw----.*/)) {
                    return true
                }
            }
            
            return false
        })
    })

    this.exercise("Datei löschen", async function () {
        this.describe(`Lösche die Datei "saetze".`)