Loading static/js/exercises.mjs +15 −15 Original line number Diff line number Diff line Loading @@ -187,21 +187,6 @@ export const pooltest = test("Pooltest Sommersemester 2022", async function () { this.verify("cat botschaft").hasOutput("Der Junge sieht den Mann mit dem Fernglas") }) this.exercise("Berechtigungen anpassen", async function () { this.describe(`Ändere die Berechtigungen der Datei "/resources/supergeheim" so, dass nur der Besitzer sie anzeigen kann (und sonst niemand).`) await this.prepareWith("mkdir /resources && echo 'Dies ist ein Geheimnis.' > /resources/supergeheim") await this.manualConfirmation() this.verify("ls -ld /resources/supergeheim").hasOutput((outputLines) => { // Verify that the output of "ls -ld /resources/supergeheim" contains the correct permissions // (the regular expression checks that the read bits are correctly set, it doesn't care about the other's) return outputLines.length === 1 && outputLines[0].substring(0, 10).match(/-r..-..-../) }) }) this.exercise("Ordner erstellen", async function () { this.describe(`Erstelle unter dem Pfad "/tmp" einen Ordner mit dem Namen "computational", in dem sich ein weiterer Ordner mit dem Namen "linguistics" befindet.`) Loading Loading @@ -233,6 +218,21 @@ export const pooltest = test("Pooltest Sommersemester 2022", async function () { this.verify("cat correct.txt").hasOutput("COLI") }) this.exercise("Berechtigungen anpassen", async function () { this.describe(`Ändere die Berechtigungen der Datei "/resources/supergeheim" so, dass nur der Besitzer sie anzeigen kann (und sonst niemand).`) await this.prepareWith("mkdir /resources && echo 'Dies ist ein Geheimnis.' > /resources/supergeheim") await this.manualConfirmation() this.verify("ls -ld /resources/supergeheim").hasOutput((outputLines) => { // Verify that the output of "ls -ld /resources/supergeheim" contains the correct permissions // (the regular expression checks that the read bits are correctly set, it doesn't care about the other's) return outputLines.length === 1 && outputLines[0].substring(0, 10).match(/-r..-..-../) }) }) // To add another exercise, simply copy and paste an exercise(...) block from above and adjust it. // Order is respected, so you can e.g. order the exercises by increasing difficulty. }) Loading
static/js/exercises.mjs +15 −15 Original line number Diff line number Diff line Loading @@ -187,21 +187,6 @@ export const pooltest = test("Pooltest Sommersemester 2022", async function () { this.verify("cat botschaft").hasOutput("Der Junge sieht den Mann mit dem Fernglas") }) this.exercise("Berechtigungen anpassen", async function () { this.describe(`Ändere die Berechtigungen der Datei "/resources/supergeheim" so, dass nur der Besitzer sie anzeigen kann (und sonst niemand).`) await this.prepareWith("mkdir /resources && echo 'Dies ist ein Geheimnis.' > /resources/supergeheim") await this.manualConfirmation() this.verify("ls -ld /resources/supergeheim").hasOutput((outputLines) => { // Verify that the output of "ls -ld /resources/supergeheim" contains the correct permissions // (the regular expression checks that the read bits are correctly set, it doesn't care about the other's) return outputLines.length === 1 && outputLines[0].substring(0, 10).match(/-r..-..-../) }) }) this.exercise("Ordner erstellen", async function () { this.describe(`Erstelle unter dem Pfad "/tmp" einen Ordner mit dem Namen "computational", in dem sich ein weiterer Ordner mit dem Namen "linguistics" befindet.`) Loading Loading @@ -233,6 +218,21 @@ export const pooltest = test("Pooltest Sommersemester 2022", async function () { this.verify("cat correct.txt").hasOutput("COLI") }) this.exercise("Berechtigungen anpassen", async function () { this.describe(`Ändere die Berechtigungen der Datei "/resources/supergeheim" so, dass nur der Besitzer sie anzeigen kann (und sonst niemand).`) await this.prepareWith("mkdir /resources && echo 'Dies ist ein Geheimnis.' > /resources/supergeheim") await this.manualConfirmation() this.verify("ls -ld /resources/supergeheim").hasOutput((outputLines) => { // Verify that the output of "ls -ld /resources/supergeheim" contains the correct permissions // (the regular expression checks that the read bits are correctly set, it doesn't care about the other's) return outputLines.length === 1 && outputLines[0].substring(0, 10).match(/-r..-..-../) }) }) // To add another exercise, simply copy and paste an exercise(...) block from above and adjust it. // Order is respected, so you can e.g. order the exercises by increasing difficulty. })