[v2,05/12] CI: Set default QEMU timeout to 10 minutes

Message ID 20230303144727.481716-6-amikan@ilbers.de
State Accepted, archived
Headers show
Series Next avocado improvements​ | expand

Commit Message

Anton Mikanovich March 3, 2023, 2:47 p.m. UTC
Also remove default value inside bash script.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 scripts/ci_build.sh    | 7 ++-----
 testsuite/README.md    | 4 ++--
 testsuite/cibuilder.py | 4 +++-
 3 files changed, 7 insertions(+), 8 deletions(-)

Patch

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 7382862..9f62db5 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -52,8 +52,6 @@  show_help() {
     echo "    -T, --tags               specify basic avocado tags."
     echo "    -q, --quiet              suppress verbose bitbake output."
     echo "    -n, --norun              do not execute QEMU run tests."
-    echo "    -t, --timeout SEC        specify time in seconds to wait before stop QEMU."
-    echo "                             The default is: 300"
     echo "    --help                   display this message and exit."
     echo
     echo "Exit status:"
@@ -62,7 +60,6 @@  show_help() {
 }
 
 QUIET="0"
-TIMEOUT=300
 
 # Parse command line to get user configuration
 while [ $# -gt 0 ]
@@ -97,7 +94,7 @@  do
         NORUN="1"
         ;;
     -t|--timeout)
-        TIMEOUT=$2
+        TIMEOUT="-p time_to_wait=$2"
         shift
         ;;
     -c|--cross|-r|--repro|-s|--sign)
@@ -154,4 +151,4 @@  set -x
 
 avocado ${VERBOSE} run "${TESTSUITE_DIR}/citest.py" \
     -t "${TAGS}" ${PARALLEL} --disable-sysinfo \
-    -p quiet="${QUIET}" -p time_to_wait="${TIMEOUT}"
+    -p quiet="${QUIET}" ${TIMEOUT}
diff --git a/testsuite/README.md b/testsuite/README.md
index d8adc7f..10fbd79 100644
--- a/testsuite/README.md
+++ b/testsuite/README.md
@@ -39,13 +39,13 @@  $ avocado run ../testsuite/citest.py -t full --max-parallel-tasks=1 -p quiet=1
 ## Fast boot test
 
 ```
-$ avocado run ../testsuite/citest.py -t startvm,fast -p time_to_wait=300
+$ avocado run ../testsuite/citest.py -t startvm,fast
 ```
 
 ## Full boot test
 
 ```
-$ avocado run ../testsuite/citest.py -t startvm,full -p time_to_wait=300
+$ avocado run ../testsuite/citest.py -t startvm,full
 ```
 
 # Running qemu images
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 5eebd5a..65eeb4b 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -15,6 +15,8 @@  from avocado import Test
 from avocado.utils import path
 from avocado.utils import process
 
+DEF_VM_TO_SEC = 600
+
 isar_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
 backup_prefix = '.ci-backup'
 
@@ -262,7 +264,7 @@  class CIBuilder(Test):
     def vm_start(self, arch='amd64', distro='buster',
                  enforce_pcbios=False, skip_modulecheck=False,
                  image='isar-image-base', cmd=None, script=None):
-        time_to_wait = self.params.get('time_to_wait', default=60)
+        time_to_wait = self.params.get('time_to_wait', default=DEF_VM_TO_SEC)
 
         self.log.info('===================================================')
         self.log.info('Running Isar VM boot test for (' + distro + '-' + arch + ')')