Commit 1d087180 authored by H. Fischer's avatar H. Fischer Committed by Jakob Moser
Browse files

Add task for ls with parameters

parent 48a228dd
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -289,6 +289,27 @@ export const pooltest = test("Pooltest Sommersemester 2022", async function () {
        this.verify("diff -r /resources/so_much /root/much &> /dev/null; if [ $? == 0 ]; then echo 'yes'; else echo 'no'; fi").hasOutput("yes")
    })

    this.exercise("Berechtigungen einer versteckten Datei herausfinden", async function () {
        this.describe(`Im Ordner "resources" im Wurzelverzeichnis liegt eine versteckte Datei mit dem Namen ".my-little-secret".
        Finde heraus, wer auf diese Datei Lesezugriff hat.`)

        await this.prepareWith(`if [[ ! -d /resources ]]; then mkdir /resources; fi &&
                                echo 'I like licorice' > /resources/.my-little-secret &&
                                chmod 640 /resources/.my-little-secret`)

        await this.manualConfirmation()

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



    // To add another exercise, simply copy and paste an exercise(...) block from above and adjust it.