From 921c9cc153174434c6464498274ae0ae9ca51efd Mon Sep 17 00:00:00 2001 From: smitsohu Date: Wed, 22 Sep 2021 20:12:58 +0200 Subject: join: add support for rlimit options --- test/environment/rlimit-join.exp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 test/environment/rlimit-join.exp (limited to 'test/environment/rlimit-join.exp') diff --git a/test/environment/rlimit-join.exp b/test/environment/rlimit-join.exp new file mode 100755 index 000000000..aa8a203c0 --- /dev/null +++ b/test/environment/rlimit-join.exp @@ -0,0 +1,36 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2021 Firejail Authors +# License GPL v2 + +set timeout 10 +cd /home +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --noprofile --name=\"rlimit testing\"\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --rlimit-nofile=1234 --join=\"rlimit testing\"\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Switching to pid" +} +sleep 1 + +send -- "cat /proc/self/limits\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Max open files 1234 1234" +} +after 100 + +send -- "exit\r" +after 100 + +puts "\nall done\n" -- cgit v1.2.3-70-g09d2