diff --git a/rapido b/rapido index 4e17cb43..09fa0bab 100755 --- a/rapido +++ b/rapido @@ -85,20 +85,17 @@ rapido_cut() exit 1 fi - pushd "$RAPIDO_DIR" > /dev/null - cut_script="cut/${testname//-/_}.sh" + cut_script="${RAPIDO_DIR}/cut/${testname//-/_}.sh" if [[ ! -x $cut_script ]]; then [[ -f $cut_script ]] \ && echo "$cut_script lacks execute permission." \ || echo "$testname not found. See \"rapido list\"." - popd > /dev/null exit fi - ./$cut_script "${post_autorun_files[@]}" + "$cut_script" "${post_autorun_files[@]}" local cut_status=$? - popd > /dev/null [ $cut_status -ne 0 ] && exit $cut_status [ -n "$boot_img" ] || exit 0 "${RAPIDO_DIR}/vm.sh" @@ -109,16 +106,13 @@ rapido_list() { local t - pushd "$RAPIDO_DIR" > /dev/null - shopt -s nullglob - for t in cut/*.sh; do - [ -x "$t" ] || continue + for t in "$RAPIDO_DIR"/cut/*.sh; do + [[ -x "$t" ]] || continue t="${t%.sh}" - t="${t//_/-}" - echo "${t#cut/}" + t="${t##*/cut/}" + echo "${t//_/-}" done - popd > /dev/null } list_commands() diff --git a/selftest/test/002 b/selftest/test/002 index a2a6857d..897763f1 100755 --- a/selftest/test/002 +++ b/selftest/test/002 @@ -8,7 +8,7 @@ set timeout 60 spawn ./rapido cut -B simple-example expect { timeout {exit 1} - "dracut: *** Creating initramfs image file" + "*** Creating initramfs image file" } expect { timeout {exit 1} diff --git a/tools/bash_completion b/tools/bash_completion index 980832cd..b62e2bd5 100644 --- a/tools/bash_completion +++ b/tools/bash_completion @@ -1,4 +1,3 @@ -#!/bin/bash # SPDX-License-Identifier: (LGPL-2.1 OR LGPL-3.0) # Copyright (C) SUSE LLC 2019-2022, all rights reserved.