aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/memwrexe.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-08-18 08:09:38 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-08-18 08:09:38 -0400
commitad262caef9f095e00ce51945020142838d93960e (patch)
treef592b6bdba5b159cfe7e09e79c1dce8b8535fd46 /test/filters/memwrexe.exp
parentprivate-lib (diff)
downloadfirejail-ad262caef9f095e00ce51945020142838d93960e.tar.gz
firejail-ad262caef9f095e00ce51945020142838d93960e.tar.zst
firejail-ad262caef9f095e00ce51945020142838d93960e.zip
memory-deny-write-execute testing
Diffstat (limited to 'test/filters/memwrexe.exp')
-rwxr-xr-xtest/filters/memwrexe.exp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/filters/memwrexe.exp b/test/filters/memwrexe.exp
new file mode 100755
index 000000000..6a57b8a07
--- /dev/null
+++ b/test/filters/memwrexe.exp
@@ -0,0 +1,34 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --memory-deny-write-execute ./memwrexe mmap\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "mmap successful" {puts "TESTING ERROR 2\n";exit}
18 "Parent is shutting down"
19}
20after 100
21
22send -- "firejail --memory-deny-write-execute ./memwrexe mprotect\r"
23expect {
24 timeout {puts "TESTING ERROR 10\n";exit}
25 "Child process initialized"
26}
27expect {
28 timeout {puts "TESTING ERROR 11\n";exit}
29 "mprotect successful" {puts "TESTING ERROR 12\n";exit}
30 "Parent is shutting down"
31}
32
33after 100
34puts "\nall done\n"