From dbb0b361a3abb95745372ba626c4427277b72ccc Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Thu, 28 Apr 2016 00:02:53 +0200 Subject: Make some tests more robust --- test/apps-x11/apps-x11.sh | 2 +- test/environment/csh.exp | 1 + test/environment/dash.exp | 1 + test/environment/environment.sh | 10 ++++++++-- test/environment/nice.exp | 8 ++++---- test/environment/rlimit-profile.exp | 1 + test/environment/rlimit.exp | 1 + test/environment/zsh.exp | 1 + test/utils/join.exp | 1 + test/utils/join2.exp | 1 + test/utils/join3.exp | 1 + test/utils/shutdown.exp | 1 + test/utils/utils.sh | 26 ++++++++++++++++++-------- 13 files changed, 40 insertions(+), 15 deletions(-) diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh index 938d4c993..2182c90a2 100755 --- a/test/apps-x11/apps-x11.sh +++ b/test/apps-x11/apps-x11.sh @@ -48,6 +48,6 @@ then echo "TESTING: icedove x11" ./icedove.exp else - echo "TESTING: icedovenot found" + echo "TESTING: icedove not found" fi diff --git a/test/environment/csh.exp b/test/environment/csh.exp index 10ad3607e..7fd69ed43 100755 --- a/test/environment/csh.exp +++ b/test/environment/csh.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/environment/dash.exp b/test/environment/dash.exp index f5a60719e..d727d302e 100755 --- a/test/environment/dash.exp +++ b/test/environment/dash.exp @@ -1,6 +1,7 @@ #!/usr/bin/expect -f set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/environment/environment.sh b/test/environment/environment.sh index ede5735c6..9164b43a2 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh @@ -51,8 +51,14 @@ echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail- echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" ./firejail-in-firejail2.exp -echo "TESTING: sound (test/environment/sound.exp)" -./sound.exp +which aplay +if [ "$?" -eq 0 ]; +then + echo "TESTING: sound (test/environment/sound.exp)" + ./sound.exp +else + echo "TESTING: aplay not found" +fi echo "TESTING: nice (test/environment/nice.exp)" ./nice.exp diff --git a/test/environment/nice.exp b/test/environment/nice.exp index 7e5731c63..3a5db71c8 100755 --- a/test/environment/nice.exp +++ b/test/environment/nice.exp @@ -17,7 +17,7 @@ sleep 1 send -- "top -b -n 1\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "netblue" + $env(USER) } expect { timeout {puts "TESTING ERROR 2\n";exit} @@ -29,7 +29,7 @@ expect { } expect { timeout {puts "TESTING ERROR 4\n";exit} - "netblu" + $env(USER) } expect { timeout {puts "TESTING ERROR 5\n";exit} @@ -54,7 +54,7 @@ sleep 1 send -- "top -b -n 1\r" expect { timeout {puts "TESTING ERROR 11\n";exit} - "netblue" + $env(USER) } expect { timeout {puts "TESTING ERROR 12\n";exit} @@ -66,7 +66,7 @@ expect { } expect { timeout {puts "TESTING ERROR 14\n";exit} - "netblu" + $env(USER) } expect { timeout {puts "TESTING ERROR 15\n";exit} diff --git a/test/environment/rlimit-profile.exp b/test/environment/rlimit-profile.exp index 7d2637444..aed634201 100755 --- a/test/environment/rlimit-profile.exp +++ b/test/environment/rlimit-profile.exp @@ -1,6 +1,7 @@ #!/usr/bin/expect -f set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/environment/rlimit.exp b/test/environment/rlimit.exp index 17d2bd9d1..680520b33 100755 --- a/test/environment/rlimit.exp +++ b/test/environment/rlimit.exp @@ -1,6 +1,7 @@ #!/usr/bin/expect -f set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/environment/zsh.exp b/test/environment/zsh.exp index 2604b2be5..96fa84dfe 100755 --- a/test/environment/zsh.exp +++ b/test/environment/zsh.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/utils/join.exp b/test/utils/join.exp index fc94a22c3..e1cd37fcb 100755 --- a/test/utils/join.exp +++ b/test/utils/join.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/utils/join2.exp b/test/utils/join2.exp index 749e8900f..820c43174 100755 --- a/test/utils/join2.exp +++ b/test/utils/join2.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/utils/join3.exp b/test/utils/join3.exp index 0a686bc36..96d3e5186 100755 --- a/test/utils/join3.exp +++ b/test/utils/join3.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp index 135f42d28..ca321b3c9 100755 --- a/test/utils/shutdown.exp +++ b/test/utils/shutdown.exp @@ -4,6 +4,7 @@ # License GPL v2 set timeout 10 +cd /home spawn $env(SHELL) match_max 100000 diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 474c026d1..1e010147d 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -12,8 +12,14 @@ echo "TESTING: version (test/utils/version.exp)" echo "TESTING: help (test/utils/help.exp)" ./help.exp -echo "TESTING: man (test/utils/man.exp)" -./man.exp +which man +if [ "$?" -eq 0 ]; +then + echo "TESTING: man (test/utils/man.exp)" + ./man.exp +else + echo "TESTING: man not found" +fi echo "TESTING: list (test/utils/list.exp)" ./list.exp @@ -21,9 +27,13 @@ echo "TESTING: list (test/utils/list.exp)" echo "TESTING: tree (test/utils/tree.exp)" ./tree.exp -echo "TESTING: cpu.print (test/utils/cpu-print.exp)" -echo "TESTING: failing under VirtualBox where there is only one CPU" -./cpu-print.exp +if [ $(grep -c ^processor /proc/cpuinfo) -gt 1 ]; +then + echo "TESTING: cpu.print (test/utils/cpu-print.exp)" + ./cpu-print.exp +else + echo "TESTING: cpu.print, not enough CPUs" +fi echo "TESTING: fs.print (test/utils/fs-print.exp)" ./fs-print.exp @@ -52,7 +62,7 @@ echo "TESTING: shutdown3 (test/utils/shutdown3.exp)" echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" ./shutdown4.exp -echo "TESTING: join test/utils/(join.exp)" +echo "TESTING: join (test/utils/join.exp)" ./join.exp echo "TESTING: join2 (test/utils/join2.exp)" @@ -72,9 +82,9 @@ rm -f index.html* echo "TESTING: firemon --seccomp (test/utils/seccomp.exp)" ./seccomp.exp -echo "TESTING: firemon --caps (test/ustil/caps.exp)" +echo "TESTING: firemon --caps (test/utils/caps.exp)" ./caps.exp -echo "TESTING: file transfer (test/ustil/ls.exp)" +echo "TESTING: file transfer (test/utils/ls.exp)" ./ls.exp -- cgit v1.2.3-54-g00ecf