aboutsummaryrefslogtreecommitdiffstats
path: root/test/ssh/sftp.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/ssh/sftp.exp')
-rwxr-xr-xtest/ssh/sftp.exp90
1 files changed, 0 insertions, 90 deletions
diff --git a/test/ssh/sftp.exp b/test/ssh/sftp.exp
deleted file mode 100755
index a3299ef26..000000000
--- a/test/ssh/sftp.exp
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "rm -f testfile\r"
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "echo 12345 > testfile\r"
24after 100
25send -- "sftp firejail-test@0\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Connected to 0"
29}
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "sftp>"
33}
34after 100
35send -- "put testfile\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "100%"
39}
40after 100
41send -- "exit\r"
42sleep 1
43
44
45send -- "ssh firejail-test@0\r"
46expect {
47 timeout {puts "TESTING ERROR 4\n";exit}
48 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
49 "an existing sandbox was detected" {puts "OK\n"}
50}
51sleep 1
52send -- "cat testfile\r"
53expect {
54 timeout {puts "TESTING ERROR 5\n";exit}
55 "12345"
56}
57after 100
58send -- "exit\r"
59sleep 1
60
61send -- "rm testfile\r"
62after 100
63send -- "sftp firejail-test@0\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 "Connected to 0"
67}
68expect {
69 timeout {puts "TESTING ERROR 7\n";exit}
70 "sftp>"
71}
72after 100
73send -- "get testfile\r"
74expect {
75 timeout {puts "TESTING ERROR 8\n";exit}
76 "100%"
77}
78after 100
79send -- "exit\r"
80sleep 1
81send -- "cat testfile\r"
82expect {
83 timeout {puts "TESTING ERROR 9\n";exit}
84 "12345"
85}
86after 100
87send -- "rm testfile\r"
88sleep 1
89
90puts "\nall done\n"