Skip to content

Commit

Permalink
tests: Add basic test suite for the run action
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Jul 27, 2023
1 parent f69ac0e commit 8fd0ace
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ jobs:
test: { name: "apertis", case: "apertis" }
- backend: { name: "uml", backend: "--fakemachine-backend=uml" }
test: { name: "partitioning", case: "partitioning" }
- backend: { name: "uml", backend: "--fakemachine-backend=uml" }
test: { name: "run", case: "run" }
name: ${{matrix.test.name}} on ${{matrix.backend.name}}
steps:
- name: Repository checkout
Expand Down
1 change: 1 addition & 0 deletions tests/run/scripts/test-broken-symlink.sh
Empty file.
1 change: 1 addition & 0 deletions tests/run/scripts/test-symlink.sh
3 changes: 3 additions & 0 deletions tests/run/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "test from script; arguments: $@"
46 changes: 46 additions & 0 deletions tests/run/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
architecture: amd64

actions:
- action: debootstrap
suite: bullseye
variant: minbase
merged-usr: true

- action: run
description: Run a script which is a symlink
script: scripts/test-symlink.sh argument1 argument2

- action: run
description: Run a script with arguments
script: scripts/test.sh argument1 argument2

- action: run
description: Run a script without arguments
script: scripts/test.sh

- action: run
description: Run a script with arguments in a chroot
chroot: true
script: scripts/test.sh argument1 argument2

- action: run
description: Run a script without arguments in chroot
chroot: true
script: scripts/test.sh

- action: run
description: Test running a command
command: echo test

# TODO: This should fail in the Verify stage, we cannot yet check that in CI
#- action: run
# description: Run a script which has a broken symlink
# chroot: true
# script: scripts/test-broken-symlink.sh

# TODO: This should fail in the Verify stage, we cannot yet check that in CI
#- action: run
# description: Run a script which has no exec bit set
# chroot: true
# script: scripts/test-broken-symlink.sh

0 comments on commit 8fd0ace

Please sign in to comment.