[Fuego] [PATCH] busybox: modify ls case.
Zheng Ruoqin
zhengrq.fnst at cn.fujitsu.com
Sun Feb 3 06:32:40 UTC 2019
Validate more fields produced by 'ls -l'.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
---
tests/Functional.busybox/tests/busybox_ls.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/Functional.busybox/tests/busybox_ls.sh b/tests/Functional.busybox/tests/busybox_ls.sh
index 4c0639f..7392ae8 100644
--- a/tests/Functional.busybox/tests/busybox_ls.sh
+++ b/tests/Functional.busybox/tests/busybox_ls.sh
@@ -8,7 +8,18 @@ test="ls"
mkdir test_dir
touch test_dir/test1 test_dir/test2 test_dir/test3
busybox ls -l ./test_dir > log
-if grep "test1" log && grep "test2" log && grep "test3" log
+
+# Validate the file mode of `ls -l`
+if [ "$(cat log | cut -d ' ' -f 1 | head -n 1)" = "-rw-r--r--" ]
+then
+ echo " -> $test: File mode is right"
+else
+ echo " -> $test: TEST-FAIL"
+fi;
+
+# Validate the filename of `ls -l`
+cat log | cut -d ':' -f 2 > filename
+if grep "test1" filename && grep "test2" filename && grep "test3" filename
then
echo " -> $test: TEST-PASS"
else
--
1.8.3.1
More information about the Fuego
mailing list