diff options
author | netblue30 <netblue30@yahoo.com> | 2018-07-27 20:48:21 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2018-07-27 20:48:21 -0400 |
commit | e40e088836289e2e6f18215922943fa241e0cfa8 (patch) | |
tree | 28b01400a2c2933d7e15ba223862e34ebae7c056 /test | |
parent | phase1 (diff) | |
download | firejail-e40e088836289e2e6f18215922943fa241e0cfa8.tar.gz firejail-e40e088836289e2e6f18215922943fa241e0cfa8.tar.zst firejail-e40e088836289e2e6f18215922943fa241e0cfa8.zip |
phase1
Diffstat (limited to 'test')
-rwxr-xr-x | test/fcopy/cmdline.exp | 46 | ||||
-rwxr-xr-x | test/fcopy/dircopy.exp | 139 | ||||
-rwxr-xr-x | test/fcopy/fcopy.sh | 33 | ||||
-rwxr-xr-x | test/fcopy/filecopy.exp | 57 | ||||
-rwxr-xr-x | test/fcopy/linkcopy.exp | 56 | ||||
-rw-r--r-- | test/fcopy/src/a/b/file4 | 11 | ||||
-rw-r--r-- | test/fcopy/src/a/file3 | 0 | ||||
l--------- | test/fcopy/src/dircopy.exp | 1 | ||||
-rwxr-xr-x | test/fcopy/src/file1 | 0 | ||||
-rw-r--r-- | test/fcopy/src/file2 | 0 | ||||
-rwxr-xr-x | test/fcopy/trailing.exp | 25 |
11 files changed, 0 insertions, 368 deletions
diff --git a/test/fcopy/cmdline.exp b/test/fcopy/cmdline.exp deleted file mode 100755 index b68a09f99..000000000 --- a/test/fcopy/cmdline.exp +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "fcopy\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "arguments missing" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Usage:" | ||
18 | } | ||
19 | after 100 | ||
20 | |||
21 | send -- "fcopy foo\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "arguments missing" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "Usage:" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "fcopy f%oo1 foo2\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "invalid source file name" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "fcopy foo1 f,oo2\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5\n";exit} | ||
42 | "invalid dest file name" | ||
43 | } | ||
44 | after 100 | ||
45 | |||
46 | puts "\nall done\n" | ||
diff --git a/test/fcopy/dircopy.exp b/test/fcopy/dircopy.exp deleted file mode 100755 index bb5a1e45e..000000000 --- a/test/fcopy/dircopy.exp +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | # | ||
7 | # copy directory src to dest | ||
8 | # | ||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | |||
13 | send -- "rm -fr dest/*\r" | ||
14 | after 100 | ||
15 | |||
16 | send -- "fcopy src dest\r" | ||
17 | after 100 | ||
18 | |||
19 | send -- "find dest\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | "dest/" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | send -- "find dest\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0\n";exit} | ||
29 | "dest/" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | send -- "find dest\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1\n";exit} | ||
36 | "dest/a" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "find dest\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "dest/a/b" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | send -- "find dest\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 3\n";exit} | ||
50 | "dest/a/b/file4" | ||
51 | } | ||
52 | after 100 | ||
53 | |||
54 | send -- "find dest\r" | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 4\n";exit} | ||
57 | "dest/a/file3" | ||
58 | } | ||
59 | after 100 | ||
60 | |||
61 | send -- "find dest\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 5\n";exit} | ||
64 | "dest/dircopy.exp" | ||
65 | } | ||
66 | after 100 | ||
67 | |||
68 | send -- "find dest\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6\n";exit} | ||
71 | "dest/file2" | ||
72 | } | ||
73 | after 100 | ||
74 | |||
75 | send -- "find dest\r" | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 7\n";exit} | ||
78 | "dest/file1" | ||
79 | } | ||
80 | after 100 | ||
81 | |||
82 | |||
83 | send -- "ls -al dest\r" | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 8\n";exit} | ||
86 | "drwxr-xr-x" { puts "umask 0022\n" } | ||
87 | "drwxrwxr-x" { puts "umask 0002\n" } | ||
88 | } | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 9\n";exit} | ||
91 | "a" | ||
92 | } | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 10\n";exit} | ||
95 | "lrwxrwxrwx" | ||
96 | } | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 11\n";exit} | ||
99 | "dircopy.exp" | ||
100 | } | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 12\n";exit} | ||
103 | "rwxr-xr-x" { puts "umask 0022\n" } | ||
104 | "rwxrwxr-x" { puts "umask 0002\n" } | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 13\n";exit} | ||
108 | "file1" | ||
109 | } | ||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 14\n";exit} | ||
112 | "rw-r--r--" { puts "umask 0022\n" } | ||
113 | "rw-rw-r--" { puts "umask 0002\n" } | ||
114 | } | ||
115 | expect { | ||
116 | timeout {puts "TESTING ERROR 15\n";exit} | ||
117 | "file2" | ||
118 | } | ||
119 | after 100 | ||
120 | |||
121 | send -- "stty -echo\r" | ||
122 | after 100 | ||
123 | send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r" | ||
124 | expect { | ||
125 | timeout {puts "TESTING ERROR 16\n";exit} | ||
126 | "differ" {puts "TESTING ERROR 17\n";exit} | ||
127 | "done" | ||
128 | } | ||
129 | |||
130 | send -- "file dest/dircopy.exp\r" | ||
131 | expect { | ||
132 | timeout {puts "TESTING ERROR 18\n";exit} | ||
133 | "symbolic link" | ||
134 | } | ||
135 | |||
136 | send -- "rm -fr dest/*\r" | ||
137 | after 100 | ||
138 | |||
139 | puts "\nall done\n" | ||
diff --git a/test/fcopy/fcopy.sh b/test/fcopy/fcopy.sh deleted file mode 100755 index b225f9ea0..000000000 --- a/test/fcopy/fcopy.sh +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | |||
9 | if [ -f /etc/debian_version ]; then | ||
10 | libdir=$(dirname "$(dpkg -L firejail | grep fcopy)") | ||
11 | export PATH="$PATH:$libdir" | ||
12 | fi | ||
13 | |||
14 | export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" | ||
15 | |||
16 | mkdir dest | ||
17 | |||
18 | echo "TESTING: fcopy cmdline (test/fcopy/cmdline.exp)" | ||
19 | ./cmdline.exp | ||
20 | |||
21 | echo "TESTING: fcopy directory (test/fcopy/dircopy.exp)" | ||
22 | ./dircopy.exp | ||
23 | |||
24 | echo "TESTING: fcopy file (test/fcopy/filecopy.exp)" | ||
25 | ./filecopy.exp | ||
26 | |||
27 | echo "TESTING: fcopy link (test/fcopy/linkcopy.exp)" | ||
28 | ./linkcopy.exp | ||
29 | |||
30 | echo "TESTING: fcopy trailing char (test/copy/trailing.exp)" | ||
31 | ./trailing.exp | ||
32 | |||
33 | rm -fr dest/* | ||
diff --git a/test/fcopy/filecopy.exp b/test/fcopy/filecopy.exp deleted file mode 100755 index e5d6fb0bc..000000000 --- a/test/fcopy/filecopy.exp +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | # | ||
7 | # copy directory src to dest | ||
8 | # | ||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | |||
13 | send -- "rm -fr dest/*\r" | ||
14 | after 100 | ||
15 | |||
16 | send -- "fcopy dircopy.exp dest\r" | ||
17 | after 100 | ||
18 | |||
19 | send -- "find dest\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | "dest" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1\n";exit} | ||
26 | "dest/dircopy.exp" | ||
27 | } | ||
28 | after 100 | ||
29 | |||
30 | |||
31 | send -- "ls -al dest\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 2\n";exit} | ||
34 | "rwxr-xr-x" { puts "umask 0022\n" } | ||
35 | "rwxrwxr-x" { puts "umask 0002\n" } | ||
36 | } | ||
37 | after 100 | ||
38 | send -- "stty -echo\r" | ||
39 | after 100 | ||
40 | |||
41 | send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "differ" {puts "TESTING ERROR 4\n";exit} | ||
45 | "done" | ||
46 | } | ||
47 | |||
48 | send -- "file dest/dircopy.exp\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 5\n";exit} | ||
51 | "ASCII text" | ||
52 | } | ||
53 | |||
54 | send -- "rm -fr dest/*\r" | ||
55 | after 100 | ||
56 | |||
57 | puts "\nall done\n" | ||
diff --git a/test/fcopy/linkcopy.exp b/test/fcopy/linkcopy.exp deleted file mode 100755 index ab3369bbc..000000000 --- a/test/fcopy/linkcopy.exp +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | # | ||
7 | # copy directory src to dest | ||
8 | # | ||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | |||
13 | send -- "rm -fr dest/*\r" | ||
14 | after 100 | ||
15 | |||
16 | send -- "fcopy src/dircopy.exp dest\r" | ||
17 | after 100 | ||
18 | |||
19 | send -- "find dest\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | "dest/" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1\n";exit} | ||
26 | "dest/dircopy.exp" | ||
27 | } | ||
28 | after 100 | ||
29 | |||
30 | |||
31 | send -- "ls -al dest\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 2\n";exit} | ||
34 | "lrwxrwxrwx" | ||
35 | } | ||
36 | after 100 | ||
37 | send -- "stty -echo\r" | ||
38 | after 100 | ||
39 | |||
40 | send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3\n";exit} | ||
43 | "differ" {puts "TESTING ERROR 4\n";exit} | ||
44 | "done" | ||
45 | } | ||
46 | |||
47 | send -- "file dest/dircopy.exp\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 5\n";exit} | ||
50 | "symbolic link" | ||
51 | } | ||
52 | |||
53 | send -- "rm -fr dest/*\r" | ||
54 | after 100 | ||
55 | |||
56 | puts "\nall done\n" | ||
diff --git a/test/fcopy/src/a/b/file4 b/test/fcopy/src/a/b/file4 deleted file mode 100644 index ac318d7ab..000000000 --- a/test/fcopy/src/a/b/file4 +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | |||
2 | |||
3 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam interdum at massa non aliquam. Maecenas molestie id orci volutpat porta. Praesent aliquam nunc quis mi tristique, ac feugiat enim rutrum. Nulla vitae metus sodales, pellentesque risus sit amet, volutpat nisl. Curabitur accumsan arcu congue lacus porta laoreet. Nulla facilisi. Integer nec augue id magna gravida tincidunt id vitae lorem. Curabitur facilisis, tellus vel pellentesque pretium, odio dolor efficitur lorem, et tincidunt dui enim cursus lacus. Cras a orci ac magna semper dapibus nec et velit. Nullam aliquam sollicitudin auctor. | ||
4 | |||
5 | Mauris ac quam vel purus volutpat semper eget a ante. Curabitur arcu nisl, dapibus ac lectus ac, porttitor fermentum metus. Aliquam et sem aliquam magna interdum ultricies at eu orci. Aenean tortor augue, volutpat nec magna nec, rutrum bibendum justo. Vivamus ex quam, auctor ut pellentesque mattis, aliquet a eros. Etiam ac lacus ac ante ullamcorper sollicitudin a quis orci. Suspendisse quis justo ac mauris cursus finibus quis at elit. Vestibulum elementum finibus diam, eget convallis purus aliquet et. Fusce fermentum ornare urna, non ornare nisl tincidunt consectetur. Donec et lacus vitae ex eleifend porttitor id ut odio. Quisque luctus eget lorem et sollicitudin. | ||
6 | |||
7 | Aliquam libero elit, finibus a nisl a, commodo viverra turpis. Nam pulvinar in est sit amet fermentum. Praesent scelerisque tempus lectus, ac porta elit sodales rutrum. Duis faucibus faucibus urna eget accumsan. Vivamus in turpis ut massa rhoncus pretium nec et lorem. Aenean at tellus eget metus porta ornare. Aliquam erat volutpat. Donec hendrerit a massa vel malesuada. Integer varius sapien et orci viverra pretium. In at velit aliquet, vulputate nisi lobortis, aliquam augue. | ||
8 | |||
9 | Ut aliquam turpis ut lorem aliquam, in faucibus elit pulvinar. Vivamus viverra tortor ornare, lacinia leo sit amet, auctor arcu. Sed erat leo, pellentesque vel nibh a, malesuada vehicula purus. Vivamus est dolor, aliquet quis facilisis fermentum, varius in dolor. Nunc quis libero feugiat, imperdiet est vitae, mollis risus. Vestibulum elementum mattis lorem vitae gravida. Nullam id tellus interdum, aliquam erat eu, laoreet nunc. Aliquam ut felis vel mauris maximus pellentesque. | ||
10 | |||
11 | Vestibulum tempus mauris eget ex interdum, vitae vehicula tortor sollicitudin. Pellentesque et dolor cursus dui vulputate laoreet. Morbi eu bibendum quam, at ultrices elit. Vestibulum dictum enim sit amet ultricies imperdiet. Praesent congue magna ac mauris mattis, a iaculis ante aliquet. Vivamus at egestas ex. Suspendisse orci dolor, pharetra at aliquam a, faucibus facilisis leo. Quisque semper lorem eget elit commodo pretium. Aenean posuere augue quis arcu finibus, sit amet fringilla risus congue. Pellentesque rutrum nunc leo, aliquam lobortis lacus molestie nec. Donec convallis congue diam, ullamcorper vestibulum dui varius nec. Praesent pellentesque nisi risus. In aliquam molestie malesuada. Nulla facilisis a risus eu tristique. Morbi molestie et arcu quis efficitur. Curabitur cursus vestibulum luctus. | ||
diff --git a/test/fcopy/src/a/file3 b/test/fcopy/src/a/file3 deleted file mode 100644 index e69de29bb..000000000 --- a/test/fcopy/src/a/file3 +++ /dev/null | |||
diff --git a/test/fcopy/src/dircopy.exp b/test/fcopy/src/dircopy.exp deleted file mode 120000 index 2acf88f7b..000000000 --- a/test/fcopy/src/dircopy.exp +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../dircopy.exp \ No newline at end of file | ||
diff --git a/test/fcopy/src/file1 b/test/fcopy/src/file1 deleted file mode 100755 index e69de29bb..000000000 --- a/test/fcopy/src/file1 +++ /dev/null | |||
diff --git a/test/fcopy/src/file2 b/test/fcopy/src/file2 deleted file mode 100644 index e69de29bb..000000000 --- a/test/fcopy/src/file2 +++ /dev/null | |||
diff --git a/test/fcopy/trailing.exp b/test/fcopy/trailing.exp deleted file mode 100755 index bd51a2b7b..000000000 --- a/test/fcopy/trailing.exp +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | # | ||
7 | # copy directory src to dest | ||
8 | # | ||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | |||
13 | send -- "firejail --private-etc=group,passwd,firejail/ ls /etc/firejail\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 0\n";exit} | ||
20 | "0ad.profile" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | |||
25 | puts "\nall done\n" | ||