From 57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 3 May 2016 08:41:24 -0400 Subject: networking features testing --- test/profiles/profile_followlnk.exp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 test/profiles/profile_followlnk.exp (limited to 'test/profiles/profile_followlnk.exp') diff --git a/test/profiles/profile_followlnk.exp b/test/profiles/profile_followlnk.exp new file mode 100755 index 000000000..4d89de26b --- /dev/null +++ b/test/profiles/profile_followlnk.exp @@ -0,0 +1,37 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "mkdir /tmp/firejailtestdir\r" +send -- "ln -s /tmp/firejailtestdir /tmp/firejailtestdirlnk\r" +send -- "touch /tmp/firejailtestfile\r" +send -- "ln -s /tmp/firejailtestfile /tmp/firejailtestfilelnk\r" +sleep 1 + +send -- "firejail --profile=readonly-lnk.profile\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} + +send -- "ls > /tmp/firejailtestdirlnk/ttt\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Read-only file system" +} +sleep 1 + +send -- "ls > /tmp/firejailtestfilelnk;pwd\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Read-only file system" +} +sleep 1 + +send -- "exit\r" +send -- "rm -fr /tmp/firejailtest*\r" +sleep 1 + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf