aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2019-02-17 17:04:02 -0600
committerLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2019-02-17 17:04:02 -0600
commit6181f75e3f1b73708eaef7e22364ed0e9a1c482e (patch)
treef888a4871612a8b9f0ef9b8f7ae916aaf105f2be /test
parentmerges (diff)
downloadfirejail-6181f75e3f1b73708eaef7e22364ed0e9a1c482e.tar.gz
firejail-6181f75e3f1b73708eaef7e22364ed0e9a1c482e.tar.zst
firejail-6181f75e3f1b73708eaef7e22364ed0e9a1c482e.zip
Housekeeping
Make sure all files end with a newline Strip extra newlines and trailing whitespace from files
Diffstat (limited to 'test')
-rwxr-xr-xtest/apps/apps.sh1
-rw-r--r--test/filters/memwrexe.c13
-rw-r--r--test/fnetfilter/test1.net1
-rw-r--r--test/fnetfilter/test2.net3
-rw-r--r--test/hidepid-howto2
-rw-r--r--test/network/tcpserver.c6
-rwxr-xr-xtest/profiles/profiles.sh1
-rw-r--r--test/profiles/test3.profile2
-rwxr-xr-xtest/root/option_tmpfs.exp1
-rw-r--r--test/utils/caps2.profile2
10 files changed, 12 insertions, 20 deletions
diff --git a/test/apps/apps.sh b/test/apps/apps.sh
index 01546d104..c239ed8b8 100755
--- a/test/apps/apps.sh
+++ b/test/apps/apps.sh
@@ -19,4 +19,3 @@ for app in $LIST; do
19 echo "TESTING SKIP: $app not found" 19 echo "TESTING SKIP: $app not found"
20 fi 20 fi
21done 21done
22
diff --git a/test/filters/memwrexe.c b/test/filters/memwrexe.c
index 7e14aa23d..b43b232d1 100644
--- a/test/filters/memwrexe.c
+++ b/test/filters/memwrexe.c
@@ -20,7 +20,7 @@ int main(int argc, char **argv) {
20 usage(); 20 usage();
21 return 1; 21 return 1;
22 } 22 }
23 23
24 if (strcmp(argv[1], "mmap") == 0) { 24 if (strcmp(argv[1], "mmap") == 0) {
25 // open some file 25 // open some file
26 int fd = open("memwrexe.c", O_RDONLY); 26 int fd = open("memwrexe.c", O_RDONLY);
@@ -28,13 +28,13 @@ int main(int argc, char **argv) {
28 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 28 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
29 return 1; 29 return 1;
30 } 30 }
31 31
32 int size = lseek(fd, 0, SEEK_END); 32 int size = lseek(fd, 0, SEEK_END);
33 if (size == -1) { 33 if (size == -1) {
34 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 34 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
35 return 1; 35 return 1;
36 } 36 }
37 37
38 void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); 38 void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
39 printf("mmap successful\n"); 39 printf("mmap successful\n");
40 40
@@ -51,19 +51,19 @@ int main(int argc, char **argv) {
51 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 51 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
52 return 1; 52 return 1;
53 } 53 }
54 54
55 int size = lseek(fd, 0, SEEK_END); 55 int size = lseek(fd, 0, SEEK_END);
56 if (size == -1) { 56 if (size == -1) {
57 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 57 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
58 return 1; 58 return 1;
59 } 59 }
60 60
61 void *p = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0); 61 void *p = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
62 if (!p) { 62 if (!p) {
63 fprintf(stderr, "TESTING ERROR: cannot map file for mprotect test\n"); 63 fprintf(stderr, "TESTING ERROR: cannot map file for mprotect test\n");
64 return 1; 64 return 1;
65 } 65 }
66 66
67 mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); 67 mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC);
68 printf("mprotect successful\n"); 68 printf("mprotect successful\n");
69 69
@@ -73,4 +73,3 @@ int main(int argc, char **argv) {
73 return 0; 73 return 0;
74 } 74 }
75} 75}
76 \ No newline at end of file
diff --git a/test/fnetfilter/test1.net b/test/fnetfilter/test1.net
index e60127373..ce21f20c2 100644
--- a/test/fnetfilter/test1.net
+++ b/test/fnetfilter/test1.net
@@ -16,4 +16,3 @@
16-A OUTPUT -p tcp --dport 3478 -j DROP 16-A OUTPUT -p tcp --dport 3478 -j DROP
17-A OUTPUT -p tcp --dport 3479 -j DROP 17-A OUTPUT -p tcp --dport 3479 -j DROP
18COMMIT 18COMMIT
19
diff --git a/test/fnetfilter/test2.net b/test/fnetfilter/test2.net
index a02785413..f389cd16d 100644
--- a/test/fnetfilter/test2.net
+++ b/test/fnetfilter/test2.net
@@ -9,11 +9,10 @@
9#-A INPUT -p icmp --$ARG1 echo-reply -j ACCEPT 9#-A INPUT -p icmp --$ARG1 echo-reply -j ACCEPT
10-A INPUT -p icmp --$ARG1 $ARG2 -j ACCEPT 10-A INPUT -p icmp --$ARG1 $ARG2 -j ACCEPT
11-A INPUT -p icmp --$ARG1 $ARG3 -j ACCEPT 11-A INPUT -p icmp --$ARG1 $ARG3 -j ACCEPT
12-A INPUT -p icmp --$ARG1 $ARG4 -j ACCEPT 12-A INPUT -p icmp --$ARG1 $ARG4 -j ACCEPT
13# disable STUN 13# disable STUN
14-A OUTPUT -p udp --dport $ARG5 -j DROP 14-A OUTPUT -p udp --dport $ARG5 -j DROP
15-A OUTPUT -p udp --dport $ARG6 -j DROP 15-A OUTPUT -p udp --dport $ARG6 -j DROP
16-A OUTPUT -p tcp --dport $ARG5 -j DROP 16-A OUTPUT -p tcp --dport $ARG5 -j DROP
17-A OUTPUT -p tcp --dport $ARG6 -j DROP 17-A OUTPUT -p tcp --dport $ARG6 -j DROP
18COMMIT 18COMMIT
19
diff --git a/test/hidepid-howto b/test/hidepid-howto
index f207c9109..0fa1e5d86 100644
--- a/test/hidepid-howto
+++ b/test/hidepid-howto
@@ -23,5 +23,3 @@ $ cat /proc/mounts | grep proc
23proc /proc proc rw,nosuid,nodev,noexec,relatime,gid=618,hidepid=2 0 0 23proc /proc proc rw,nosuid,nodev,noexec,relatime,gid=618,hidepid=2 0 0
24 24
253. Test "firejail --list", "firejail --top", "firejail --tree", "firejail --netstats" 253. Test "firejail --list", "firejail --top", "firejail --tree", "firejail --netstats"
26
27
diff --git a/test/network/tcpserver.c b/test/network/tcpserver.c
index e8f89b097..9de965858 100644
--- a/test/network/tcpserver.c
+++ b/test/network/tcpserver.c
@@ -35,7 +35,7 @@ int main(int argc, char **argv) {
35 return 1; 35 return 1;
36 } 36 }
37 int portno = atoi(argv[1]); 37 int portno = atoi(argv[1]);
38 38
39 // init socket 39 // init socket
40 fd = socket(AF_INET, SOCK_STREAM, 0); 40 fd = socket(AF_INET, SOCK_STREAM, 0);
41 if (fd < 0) { 41 if (fd < 0) {
@@ -82,7 +82,7 @@ int main(int argc, char **argv) {
82 if (pid == 0) { 82 if (pid == 0) {
83 // child 83 // child
84 close(fd); 84 close(fd);
85#define MAXBUF 4096 85#define MAXBUF 4096
86 char buf[MAXBUF]; 86 char buf[MAXBUF];
87 memset(buf, 0, MAXBUF); 87 memset(buf, 0, MAXBUF);
88 88
@@ -103,6 +103,6 @@ int main(int argc, char **argv) {
103 else 103 else
104 close(newfd); 104 close(newfd);
105 } 105 }
106 106
107 return 0; 107 return 0;
108} 108}
diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh
index 46662cef5..85e5c1c13 100755
--- a/test/profiles/profiles.sh
+++ b/test/profiles/profiles.sh
@@ -43,4 +43,3 @@ do
43 echo "TESTING: $PROFILE" 43 echo "TESTING: $PROFILE"
44 ./test-profile.exp $PROFILE 44 ./test-profile.exp $PROFILE
45done 45done
46
diff --git a/test/profiles/test3.profile b/test/profiles/test3.profile
index c28ddadb5..5a70bd829 100644
--- a/test/profiles/test3.profile
+++ b/test/profiles/test3.profile
@@ -1 +1 @@
include test3.profile \ No newline at end of file include test3.profile
diff --git a/test/root/option_tmpfs.exp b/test/root/option_tmpfs.exp
index 3d492dfdb..cac692cb2 100755
--- a/test/root/option_tmpfs.exp
+++ b/test/root/option_tmpfs.exp
@@ -37,4 +37,3 @@ after 100
37 37
38 38
39puts "\nall done\n" 39puts "\nall done\n"
40
diff --git a/test/utils/caps2.profile b/test/utils/caps2.profile
index cb2258c52..e760d4cb5 100644
--- a/test/utils/caps2.profile
+++ b/test/utils/caps2.profile
@@ -1 +1 @@
caps.keep chown,kill \ No newline at end of file caps.keep chown,kill