diff options
author | 2022-02-20 08:05:33 -0500 | |
---|---|---|
committer | 2022-02-20 08:05:33 -0500 | |
commit | e6c50240f9f2033a896df5a06c6fc7c1529d5442 (patch) | |
tree | 6bb24b2a55641caa80d5c69ade958b1e0b5ee59b /test | |
parent | Merge pull request #4948 from crocket/master (diff) | |
download | firejail-e6c50240f.tar.gz firejail-e6c50240f.tar.zst firejail-e6c50240f.zip |
--tab: enable shell tab completion
Diffstat (limited to 'test')
-rwxr-xr-x | test/fs/fs.sh | 3 | ||||
-rwxr-xr-x | test/fs/tab.exp | 46 | ||||
-rw-r--r-- | test/fs/tab.profile | 1 |
3 files changed, 50 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 0ec714ffa..b49e447b7 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -10,6 +10,9 @@ export LC_ALL=C | |||
10 | # These directories are required by some tests: | 10 | # These directories are required by some tests: |
11 | mkdir -p ~/Desktop ~/Documents ~/Downloads ~/Music ~/Pictures ~/Videos | 11 | mkdir -p ~/Desktop ~/Documents ~/Downloads ~/Music ~/Pictures ~/Videos |
12 | 12 | ||
13 | echo "TESTING: tab completion (test/fs/tab.exp)" | ||
14 | ./tab.exp | ||
15 | |||
13 | rm -fr ~/_firejail_test_* | 16 | rm -fr ~/_firejail_test_* |
14 | echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)" | 17 | echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)" |
15 | ./mkdir_mkfile.exp | 18 | ./mkdir_mkfile.exp |
diff --git a/test/fs/tab.exp b/test/fs/tab.exp new file mode 100755 index 000000000..cc9e11ed5 --- /dev/null +++ b/test/fs/tab.exp | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2022 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | |||
11 | send -- "firejail --private ls -al\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | ".inputrc" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | send -- "firejail --private --tab ls -al\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 2\n";exit} | ||
25 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3\n";exit} | ||
29 | ".inputrc" {puts "TESTING ERROR 4\n";exit} | ||
30 | "Parent is shutting down" | ||
31 | } | ||
32 | sleep 1 | ||
33 | |||
34 | send -- "firejail --private --profile=tab.profile ls -al\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 5\n";exit} | ||
37 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 6\n";exit} | ||
41 | ".inputrc" {puts "TESTING ERROR 7\n";exit} | ||
42 | "Parent is shutting down" | ||
43 | } | ||
44 | sleep 1 | ||
45 | |||
46 | puts "\nall done\n" | ||
diff --git a/test/fs/tab.profile b/test/fs/tab.profile new file mode 100644 index 000000000..8cc35a3d5 --- /dev/null +++ b/test/fs/tab.profile | |||
@@ -0,0 +1 @@ | |||
tab | |||