mirror of
https://github.com/opencontainers/runc.git
synced 2026-11-06 05:17:05 +00:00
The point of the assert helpers is that a failed test says what it wanted and what it got, so leaving most comparisons as bare [[ ]] defeats it. Convert the rest of the checks on $output and $lines. Those using a glob to look for a substring become --partial, the rest become --regexp (the patterns are translated to extended regular expressions, and anchored where the glob was). The few remaining [[ ]] are not assertions: one is an if condition, and another one is the left hand side of ||, offering an alternative to the assert that follows it. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
19 lines
395 B
Bash
19 lines
395 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
function setup() {
|
|
requires root apparmor
|
|
setup_busybox
|
|
}
|
|
|
|
function teardown() {
|
|
teardown_bundle
|
|
}
|
|
|
|
@test "runc run [unloaded apparmor profile]" {
|
|
update_config ' .process.apparmorProfile = "runc-test-definitely-not-loaded"'
|
|
run ! runc run test_apparmor
|
|
assert_output --regexp 'apparmor profile .*runc-test-definitely-not-loaded.*profile not loaded'
|
|
}
|