mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-08-19 13:06:41 +00:00
963e8117b4
Three functional tests depend on the effective UID being non-zero (non-root), so skip the tests if running as root. Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
24 lines
510 B
Bash
Executable File
24 lines
510 B
Bash
Executable File
#!/usr/bin/env bats
|
|
|
|
load "../swupdlib"
|
|
|
|
@test "make_fullfiles required arg" {
|
|
run $MAKE_FULLFILES
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "make_fullfiles too many arguments" {
|
|
# exactly one argument must be passed
|
|
run $MAKE_FULLFILES foo bar
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "make_fullfiles root priv check" {
|
|
[ $EUID -eq 0 ] && skip "test can only be run as non-root"
|
|
run $MAKE_FULLFILES foo
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" =~ "not being run as root.. exiting" ]]
|
|
}
|
|
|
|
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|