-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_shell.sh
executable file
·94 lines (65 loc) · 1.5 KB
/
test_shell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env -S expect -f
# usage ./test_command.sh <number_of_your_profile> <bucket_name>
set item [lindex $argv 0]
set bucket [lindex $argv 1]
set prompt "s3rs.*>";
set timeout 180
spawn rm -f /tmp/test
spawn rm -f /tmp/test-orig
spawn cp README.md test
spawn dd if=/dev/urandom bs=1024 count=11264 of=/tmp/test-orig
spawn cargo run
expect "Selection:"
send $item\r
expect -re $prompt
send ls\r
expect -re $prompt
send "log debug\r"
expect -re $prompt
send "put test s3://$bucket\r"
expect -re $prompt
send "log error\r"
expect -re $prompt
send "ls s3://$bucket\r"
expect -re $prompt
send "ls /$bucket\r"
expect -re $prompt
send "ls $bucket\r"
expect -re $prompt
send "la\r"
expect -re $prompt
send "ll s3://$bucket/te\r"
expect -re $prompt
send "cat s3://$bucket/test\r"
expect -re $prompt
send "tag add s3://$bucket/test a=1 b=2\r"
expect -re $prompt
send "tag ls s3://$bucket/test\r"
expect -re $prompt
send "tag del s3://$bucket/test\r"
expect -re $prompt
send "tag list s3://$bucket/test\r"
expect -re $prompt
send "rm s3://$bucket/test\r"
expect -re $prompt
send "ll $bucket\r"
expect -re $prompt
send "info $bucket\r"
expect -re $prompt
send "logout\n"
expect "Selection:"
send $item\r
expect -re $prompt
send "log info\r"
expect -re $prompt
send "put /tmp/test-orig s3://$bucket\r"
expect -re $prompt
send "get s3://$bucket/test-orig /tmp/test\r"
expect -re $prompt
send "exit\r"
send "rm -f test\r"
expect "cya~"
spawn rm -f test
spawn md5sum /tmp/test-orig /tmp/test
interact
spawn rm -f test