From 0b9931516ddc23e3b821ed2de1f45692a06f0d4d Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 28 Oct 2019 14:07:41 -0700 Subject: [PATCH] test: Fix a few instances of errant cd Don't change the directory of the script if at all possible. Change-Id: I5e20784694cb61fac2cf148628de566361e2673e Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472650 Reviewed-by: yidong0635 Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins --- autopackage.sh | 16 ++++------------ test/unit/unittest.sh | 4 +--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/autopackage.sh b/autopackage.sh index eff16daaa8..9ba3322e93 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -55,30 +55,22 @@ echo "tmpdir=$tmpdir" tar -C "$tmpdir" -xf $spdk_tarball if [ -z "$WITH_DPDK_DIR" ]; then - cd dpdk - git archive HEAD^{tree} --prefix=dpdk/ -o ../${dpdk_tarball} - cd .. + cd dpdk && git archive HEAD^{tree} --prefix=dpdk/ -o ../${dpdk_tarball} tar -C "$tmpdir/${spdk_pv}" -xf $dpdk_tarball fi if [ -d "intel-ipsec-mb" ]; then - cd intel-ipsec-mb - git archive HEAD^{tree} --prefix=intel-ipsec-mb/ -o ../${ipsec_tarball} - cd .. + cd intel-ipsec-mb && git archive HEAD^{tree} --prefix=intel-ipsec-mb/ -o ../${ipsec_tarball} tar -C "$tmpdir/${spdk_pv}" -xf $ipsec_tarball fi if [ -d "isa-l" ]; then - cd isa-l - git archive HEAD^{tree} --prefix=isa-l/ -o ../${isal_tarball} - cd .. + cd isa-l && git archive HEAD^{tree} --prefix=isa-l/ -o ../${isal_tarball} tar -C "$tmpdir/${spdk_pv}" -xf $isal_tarball fi if [ -d "ocf" ]; then - cd ocf - git archive HEAD^{tree} --prefix=ocf/ -o ../${ocf_tarball} - cd .. + cd ocf && git archive HEAD^{tree} --prefix=ocf/ -o ../${ocf_tarball} tar -C "$tmpdir/${spdk_pv}" -xf $ocf_tarball fi diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 0a6dc6af08..95ebad8b41 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -188,9 +188,7 @@ if [ "$cov_avail" = "yes" ]; then rm -f $UT_COVERAGE/ut_cov_base.info $UT_COVERAGE/ut_cov_test.info genhtml $UT_COVERAGE/ut_cov_unit.info --output-directory $UT_COVERAGE # git -C option not used for compatibility reasons - cd $rootdir - git clean -f "*.gcda" - cd - + cd $rootdir && git clean -f "*.gcda" fi set +x