diff --git a/tests/test_images.sh b/tests/test_images.sh index 00498517e..5464c6215 100755 --- a/tests/test_images.sh +++ b/tests/test_images.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (c) 2018 Intel Corporation # @@ -36,27 +36,21 @@ test_initrds_only="false" usage() { cat <] - $script_name [options] +Usage: $script_name [options] [command | ] Options: - -h | --help # Show usage. --distro # Only run tests for specified distro. --list # List all distros that can be tested. --test-images-only # Only run images tests for the list of distros under test. --test-initrds-only # Only run initrds tests for the list of distros under test. -Parameters: - - +Commands: help : Show usage. - : Only run tests for specified distro. -Notes: - -- If no options or parameters are specified, all tests will be run. +When is specified, tests are run only for the specified distribution. +Otherwise, tests are be run on all distros. EOT } @@ -99,8 +93,6 @@ exit_handler() sudo -E ps -efwww | egrep "docker|kata" >&2 } -trap exit_handler EXIT ERR - die() { msg="$*" @@ -504,10 +496,12 @@ main() [ "$1" = "--" ] && shift case "$1" in - help) usage && exit 0;; + help) usage; exit 0;; + *) distro="$1";; esac + trap exit_handler EXIT ERR setup if [ -n "$distro" ]