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 <chris.obbard@collabora.com>
  • Loading branch information
obbardc committed Jan 10, 2024
1 parent 2271dfd commit 8c6a800
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 @@ -138,6 +138,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 8c6a800

Please sign in to comment.