Commit cf534e20 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add preparation logic and TODO comments

parent 4bf37bc1
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Auch versteckte Dateien anzeigen", async function () {
        this.describe(`Lass dir anzeigen, welche Dateien sich in diesem Verzeichnis befinden (inklusive versteckter Dateien).`)

        await this.prepareWith("cd /root; if [[ ! -f .ash_history ]]; touch .ash_history; fi")

        await this.manualConfirmation()

        this.verify().hasOutput((outputLines) => {
@@ -36,6 +38,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Verzeichnis anlegen", async function () {
        this.describe(`Erstelle einen Ordner (= ein Verzeichnis) mit dem Namen "tux" (ohne Anführungszeichen).`)

        await this.prepareWith("cd /root; if [[ -d tux ]]; then rm -r tux; fi")

        await this.manualConfirmation()

        this.verify("if [[ -d tux ]]; then echo yes; else echo no; fi").hasOutput("yes")
@@ -44,6 +48,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Aktuelles Verzeichnis anzeigen", async function () {
        this.describe("Lass dir anzeigen, in welchem Verzeichnis du gerade arbeitest.")

        await this.prepareWith("cd /root")

        await this.manualConfirmation()

        this.verify().hasOutput("/root")
@@ -52,6 +58,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Verzeichnis wechseln", async function() {
        this.describe(`Wechsele in das von dir erstelle Verzeichnis "tux".`)

        await this.prepareWith("cd /root; if [[ ! -d tux ]]; then mkdir tux; fi")

        await this.manualConfirmation()

        this.verify("pwd").hasOutput("/root/tux")
@@ -61,6 +69,8 @@ export const practice = test("Linux-Übungsmodus", function() {
        this.describe(`Erstelle eine Textdatei mit dem Namen "satz" und dem Inhalt "Colorless green ideas sleep furiously." 
                      (jeweils ohne Anführungszeichen).`)

        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; if [[ -f satz ]]; then rm satz; fi")

        await this.manualConfirmation()

        this.verify("cat satz").hasOutput("Colorless green ideas sleep furiously.")
@@ -69,6 +79,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Datei umbenennen", async function () {
        this.describe(`Ändere den Namen der Datei "satz" in "saetze".`)

        await this.prepareWith("if [[ ! -d /root/tux ]]; then mkdir /root/tux; fi; cd /root/tux; if [[ -f saetze ]]; then rm saetze; fi; if [[ ! -f satz ]]; then touch satz; fi")

        await this.manualConfirmation()

        this.verify("if [[ -f saetze && ! -f satz ]]; then echo yes; else echo no; fi").hasOutput("yes")
@@ -77,6 +89,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Datei bearbeiten", async function () {
        this.describe(`Füge die Zeile "The cat is on the mat." ans Ende der Datei "saetze" an.`)

        // TODO Add preparation logic

        await this.manualConfirmation()

        this.verify("cat saetze").hasOutput(["Colorless green ideas sleep furiously.", "The cat is on the mat."])
@@ -85,6 +99,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Inhalt anzeigen", async function () {
        this.describe(`Zeige den Inhalt der Datei "saetze" auf der Konsole an.`)

        // TODO Add preparation logic

        await this.manualConfirmation()

        this.verify().hasOutput(["Colorless green ideas sleep furiously.", "The cat is on the mat."])
@@ -93,6 +109,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Berechtigungen ändern", async function () {
        this.describe(`Ändere die Dateirechte von "saetze" so, dass der Besitzer die Datei nur lesen kann, die besitzende Gruppe die Datei lesen und schreiben kann und alle anderen gar nichts dürfen.`)

        // TODO Add preparation logic

        await this.manualConfirmation()

        this.verify("ls -ld saetze").hasOutput((outputLines) => {
@@ -103,6 +121,8 @@ 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.`)

        // TODO Add preparation logic

        await this.manualConfirmation()

        this.verify().hasOutput((outputLines) => {
@@ -119,6 +139,8 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Datei löschen", async function () {
        this.describe(`Lösche die Datei "saetze".`)

        // TODO Add preparation logic

        await this.manualConfirmation()

        this.verify("if [[ ! -e saetze ]]; then echo yes; else echo no; fi").hasOutput("yes")