mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-08-28 13:45:42 +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>
30 lines
587 B
Bash
Executable File
30 lines
587 B
Bash
Executable File
#!/usr/bin/env bats
|
|
|
|
load "../swupdlib"
|
|
|
|
@test "make_pack required arg" {
|
|
run $MAKE_PACK
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "make_pack too few arguments" {
|
|
run $MAKE_PACK foo
|
|
[ "$status" -eq 1 ]
|
|
run $MAKE_PACK foo bar
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "make_pack too many arguments" {
|
|
run $MAKE_PACK foo bar foo bar
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "make_pack root priv check" {
|
|
[ $EUID -eq 0 ] && skip "test can only be run as non-root"
|
|
run $MAKE_PACK foo bar foo
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" =~ "not being run as root.. exiting" ]]
|
|
}
|
|
|
|
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|