Various test-scaffolding fixes

* Skip some tests if the bridge-custom plugin is
  unavailable. This CNI plugin is not distributed in
  any RPM, it is only available by compiling from a
  side branch in runcom's private github. We can't
  use it in a real integration-test setting.

* Don't use `run()` inside cleanup handlers. It will
  override $status, which is a double whammy:
   - successful cleanup will mask a test failure
   - when a test is `skip()`ed, crictl may fail,
     and $status will indicate failure.

* seccomp test: use existing $SECCOMP_PROFILE instead of
  assuming a path under $CRIO_ROOT

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago 2017-11-01 15:02:51 -06:00
parent 6b6d634cfc
commit b7697672f0
3 changed files with 18 additions and 12 deletions

View file

@ -290,8 +290,8 @@ function start_crio() {
}
function cleanup_ctrs() {
run crictl ps --quiet
if [ "$status" -eq 0 ]; then
output=$(crictl ps --quiet)
if [ $? -eq 0 ]; then
if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line
do
@ -304,8 +304,8 @@ function cleanup_ctrs() {
}
function cleanup_images() {
run crictl images --quiet
if [ "$status" -eq 0 ]; then
output=$(crictl images --quiet)
if [ $? -eq 0 ]; then
if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line
do
@ -316,8 +316,8 @@ function cleanup_images() {
}
function cleanup_pods() {
run crictl sandboxes --quiet
if [ "$status" -eq 0 ]; then
output=$(crictl sandboxes --quiet)
if [ $? -eq 0 ]; then
if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line
do