Skip to contentSkip to conversation

du01.sh: Fix broken directory change

PATCH In review Martin Doucha 2 participants 3 messages Aug 30, 2022 – Aug 31, 2022

lore
Share & tools
lore
#0 lore raw

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

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

---

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(-)
testcases/commands/du/du01.sh +1 -1
index 274e32a4e..5548d7667 100755
@@ -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
 
Signature · 5 lines
2.37.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH 2/2 du01.sh: Avoid l10n issues

Some du01.sh subtests are language dependent. Prevent failures on non-English systems by setting test locale to C.

---
 testcases/commands/du/du01.sh | 3 +++
 1 file changed, 3 insertions(+)
testcases/commands/du/du01.sh +3 -0
index 5548d7667..7977fd461 100755
@@ -27,6 +27,9 @@ setup()
 	# BLOCKSIZE environment variables. Here we need to
 	# set DU_BLOCK_SIZE to 1024 to ensure the result is expected.
 	export DU_BLOCK_SIZE=1024
+
+	# Some subtests are language dependent
+	export LC_ALL=C
 }
 
 du_test()
Signature · 5 lines
2.37.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp