From e6c50240f9f2033a896df5a06c6fc7c1529d5442 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 20 Feb 2022 08:05:33 -0500 Subject: --tab: enable shell tab completion --- test/fs/fs.sh | 3 +++ test/fs/tab.exp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ test/fs/tab.profile | 1 + 3 files changed, 50 insertions(+) create mode 100755 test/fs/tab.exp create mode 100644 test/fs/tab.profile (limited to 'test/fs') diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 0ec714ffa..b49e447b7 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh @@ -10,6 +10,9 @@ export LC_ALL=C # These directories are required by some tests: mkdir -p ~/Desktop ~/Documents ~/Downloads ~/Music ~/Pictures ~/Videos +echo "TESTING: tab completion (test/fs/tab.exp)" +./tab.exp + rm -fr ~/_firejail_test_* echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)" ./mkdir_mkfile.exp diff --git a/test/fs/tab.exp b/test/fs/tab.exp new file mode 100755 index 000000000..cc9e11ed5 --- /dev/null +++ b/test/fs/tab.exp @@ -0,0 +1,46 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2022 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + + +send -- "firejail --private ls -al\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +expect { + timeout {puts "TESTING ERROR 1\n";exit} + ".inputrc" +} +sleep 1 + +send -- "firejail --private --tab ls -al\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ".inputrc" {puts "TESTING ERROR 4\n";exit} + "Parent is shutting down" +} +sleep 1 + +send -- "firejail --private --profile=tab.profile ls -al\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + ".inputrc" {puts "TESTING ERROR 7\n";exit} + "Parent is shutting down" +} +sleep 1 + +puts "\nall done\n" diff --git a/test/fs/tab.profile b/test/fs/tab.profile new file mode 100644 index 000000000..8cc35a3d5 --- /dev/null +++ b/test/fs/tab.profile @@ -0,0 +1 @@ +tab -- cgit v1.2.3-54-g00ecf