[LTP] [PATCH 1/2] du01.sh: Fix broken directory change

Martin Doucha mdoucha@suse.cz
Tue Aug 30 16:24:15 CEST 2022


Running `ROD cd dir` doesn't work because the command will be executed
in a subshell. Change the directory correctly.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---

After this fix, my older tst_rod patch can be safely merged.

 testcases/commands/du/du01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/commands/du/du01.sh b/testcases/commands/du/du01.sh
index 274e32a4e..5548d7667 100755
--- a/testcases/commands/du/du01.sh
+++ b/testcases/commands/du/du01.sh
@@ -14,7 +14,7 @@ TST_NEEDS_CMDS="dd du stat"
 setup()
 {
 	ROD_SILENT mkdir basedir
-	ROD_SILENT cd basedir
+	cd basedir || tst_brk TBROK "cd basedir failed"
 
 	ROD_SILENT dd if=/dev/zero of=testfile bs=1M count=10
 
-- 
2.37.2



More information about the ltp mailing list