aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-07-27 20:48:21 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-07-27 20:48:21 -0400
commite40e088836289e2e6f18215922943fa241e0cfa8 (patch)
tree28b01400a2c2933d7e15ba223862e34ebae7c056 /test
parentphase1 (diff)
downloadfirejail-e40e088836289e2e6f18215922943fa241e0cfa8.tar.gz
firejail-e40e088836289e2e6f18215922943fa241e0cfa8.tar.zst
firejail-e40e088836289e2e6f18215922943fa241e0cfa8.zip
phase1
Diffstat (limited to 'test')
-rwxr-xr-xtest/fcopy/cmdline.exp46
-rwxr-xr-xtest/fcopy/dircopy.exp139
-rwxr-xr-xtest/fcopy/fcopy.sh33
-rwxr-xr-xtest/fcopy/filecopy.exp57
-rwxr-xr-xtest/fcopy/linkcopy.exp56
-rw-r--r--test/fcopy/src/a/b/file411
-rw-r--r--test/fcopy/src/a/file30
l---------test/fcopy/src/dircopy.exp1
-rwxr-xr-xtest/fcopy/src/file10
-rw-r--r--test/fcopy/src/file20
-rwxr-xr-xtest/fcopy/trailing.exp25
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "fcopy\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "arguments missing"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Usage:"
18}
19after 100
20
21send -- "fcopy foo\r"
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "arguments missing"
25}
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "Usage:"
29}
30after 100
31
32send -- "fcopy f%oo1 foo2\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "invalid source file name"
36}
37after 100
38
39send -- "fcopy foo1 f,oo2\r"
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "invalid dest file name"
43}
44after 100
45
46puts "\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#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "rm -fr dest/*\r"
14after 100
15
16send -- "fcopy src dest\r"
17after 100
18
19send -- "find dest\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "dest/"
23}
24after 100
25
26send -- "find dest\r"
27expect {
28 timeout {puts "TESTING ERROR 0\n";exit}
29 "dest/"
30}
31after 100
32
33send -- "find dest\r"
34expect {
35 timeout {puts "TESTING ERROR 1\n";exit}
36 "dest/a"
37}
38after 100
39
40send -- "find dest\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "dest/a/b"
44}
45after 100
46
47send -- "find dest\r"
48expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "dest/a/b/file4"
51}
52after 100
53
54send -- "find dest\r"
55expect {
56 timeout {puts "TESTING ERROR 4\n";exit}
57 "dest/a/file3"
58}
59after 100
60
61send -- "find dest\r"
62expect {
63 timeout {puts "TESTING ERROR 5\n";exit}
64 "dest/dircopy.exp"
65}
66after 100
67
68send -- "find dest\r"
69expect {
70 timeout {puts "TESTING ERROR 6\n";exit}
71 "dest/file2"
72}
73after 100
74
75send -- "find dest\r"
76expect {
77 timeout {puts "TESTING ERROR 7\n";exit}
78 "dest/file1"
79}
80after 100
81
82
83send -- "ls -al dest\r"
84expect {
85 timeout {puts "TESTING ERROR 8\n";exit}
86 "drwxr-xr-x" { puts "umask 0022\n" }
87 "drwxrwxr-x" { puts "umask 0002\n" }
88}
89expect {
90 timeout {puts "TESTING ERROR 9\n";exit}
91 "a"
92}
93expect {
94 timeout {puts "TESTING ERROR 10\n";exit}
95 "lrwxrwxrwx"
96}
97expect {
98 timeout {puts "TESTING ERROR 11\n";exit}
99 "dircopy.exp"
100}
101expect {
102 timeout {puts "TESTING ERROR 12\n";exit}
103 "rwxr-xr-x" { puts "umask 0022\n" }
104 "rwxrwxr-x" { puts "umask 0002\n" }
105}
106expect {
107 timeout {puts "TESTING ERROR 13\n";exit}
108 "file1"
109}
110expect {
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}
115expect {
116 timeout {puts "TESTING ERROR 15\n";exit}
117 "file2"
118}
119after 100
120
121send -- "stty -echo\r"
122after 100
123send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r"
124expect {
125 timeout {puts "TESTING ERROR 16\n";exit}
126 "differ" {puts "TESTING ERROR 17\n";exit}
127 "done"
128}
129
130send -- "file dest/dircopy.exp\r"
131expect {
132 timeout {puts "TESTING ERROR 18\n";exit}
133 "symbolic link"
134}
135
136send -- "rm -fr dest/*\r"
137after 100
138
139puts "\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
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8
9if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
11 export PATH="$PATH:$libdir"
12fi
13
14export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
15
16mkdir dest
17
18echo "TESTING: fcopy cmdline (test/fcopy/cmdline.exp)"
19./cmdline.exp
20
21echo "TESTING: fcopy directory (test/fcopy/dircopy.exp)"
22./dircopy.exp
23
24echo "TESTING: fcopy file (test/fcopy/filecopy.exp)"
25./filecopy.exp
26
27echo "TESTING: fcopy link (test/fcopy/linkcopy.exp)"
28./linkcopy.exp
29
30echo "TESTING: fcopy trailing char (test/copy/trailing.exp)"
31./trailing.exp
32
33rm -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#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "rm -fr dest/*\r"
14after 100
15
16send -- "fcopy dircopy.exp dest\r"
17after 100
18
19send -- "find dest\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "dest"
23}
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "dest/dircopy.exp"
27}
28after 100
29
30
31send -- "ls -al dest\r"
32expect {
33 timeout {puts "TESTING ERROR 2\n";exit}
34 "rwxr-xr-x" { puts "umask 0022\n" }
35 "rwxrwxr-x" { puts "umask 0002\n" }
36}
37after 100
38send -- "stty -echo\r"
39after 100
40
41send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r"
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "differ" {puts "TESTING ERROR 4\n";exit}
45 "done"
46}
47
48send -- "file dest/dircopy.exp\r"
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "ASCII text"
52}
53
54send -- "rm -fr dest/*\r"
55after 100
56
57puts "\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#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "rm -fr dest/*\r"
14after 100
15
16send -- "fcopy src/dircopy.exp dest\r"
17after 100
18
19send -- "find dest\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "dest/"
23}
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "dest/dircopy.exp"
27}
28after 100
29
30
31send -- "ls -al dest\r"
32expect {
33 timeout {puts "TESTING ERROR 2\n";exit}
34 "lrwxrwxrwx"
35}
36after 100
37send -- "stty -echo\r"
38after 100
39
40send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "differ" {puts "TESTING ERROR 4\n";exit}
44 "done"
45}
46
47send -- "file dest/dircopy.exp\r"
48expect {
49 timeout {puts "TESTING ERROR 5\n";exit}
50 "symbolic link"
51}
52
53send -- "rm -fr dest/*\r"
54after 100
55
56puts "\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
3Lorem 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
5Mauris 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
7Aliquam 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
9Ut 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
11Vestibulum 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#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "firejail --private-etc=group,passwd,firejail/ ls /etc/firejail\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18expect {
19 timeout {puts "TESTING ERROR 0\n";exit}
20 "0ad.profile"
21}
22after 100
23
24
25puts "\nall done\n"