njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
| 3 | # Testing various shell script invocations. |
| 4 | |
| 5 | #---------------------------------------------------------------------------- |
| 6 | # Shell scripts that should fail |
| 7 | #---------------------------------------------------------------------------- |
florian | c6fccd6 | 2012-02-15 03:57:27 +0000 | [diff] [blame] | 8 | LC_ALL=C |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 9 | echo "Execute a directory" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 10 | ./x86/ |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 11 | |
| 12 | echo "Execute a non-executable file" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 13 | ./shell.vgtest |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 14 | |
| 15 | echo "Execute a script with a bad interpreter name" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 16 | ./shell_badinterp |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 17 | |
| 18 | echo "Execute a binary file" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 19 | ./shell_binaryfile |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 20 | |
| 21 | echo "Execute a non-existent file" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 22 | ./shell_nosuchfile |
| 23 | |
| 24 | echo "Execute a non-existent file (2)" |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 25 | shell_nosuchfile |
| 26 | |
| 27 | #---------------------------------------------------------------------------- |
| 28 | # Shell scripts that should pass |
| 29 | #---------------------------------------------------------------------------- |
| 30 | echo "Execute a valid script with a #! line" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 31 | ./shell_valid1 |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 32 | |
| 33 | echo "Execute a valid script without a #! line" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 34 | ./shell_valid2 |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 35 | |
| 36 | echo "Execute a valid script with #! but no interpname" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 37 | ./shell_valid3 |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 38 | |
| 39 | echo "Execute a zero-length file" |
njn | 746f02c | 2005-10-15 15:28:31 +0000 | [diff] [blame] | 40 | ./shell_zerolength |
njn | 7375061 | 2005-10-14 03:11:30 +0000 | [diff] [blame] | 41 | |