-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtest_app_full.exp
More file actions
61 lines (51 loc) · 1.55 KB
/
test_app_full.exp
File metadata and controls
61 lines (51 loc) · 1.55 KB
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
#!/usr/bin/expect -f
# Standard Test Case for kejilion.sh Apps
# Usage: ./test_app_full.exp <app_id>
set app_id [lindex $argv 0]
set timeout 900
if {$app_id == ""} {
send_user "Usage: ./test_app_full.exp <app_id>\n"
exit 1
}
send_user "\n>>> STARTING TEST FOR: $app_id <<<\n"
spawn bash -c "curl -sL kejilion.sh | bash -s app $app_id"
expect {
# 如果还在主菜单(搜索页)
"请输入编号" {
send "$app_id\r"
exp_continue
}
# 进入应用管理菜单后,依次执行各个环节
"1. 安装应用" {
send_user "\n[STEP] In App Menu. Testing Status (4)...\n"
send "4\r"
expect "按任意键继续" { send "\r" }
send_user "\n[STEP] Testing Install/Update (1)...\n"
send "1\r"
expect {
"y/n" { send "y\r"; exp_continue }
"确认" { send "y\r"; exp_continue }
"端口" { send "\r"; exp_continue }
"按任意键继续" { send "\r" }
}
send_user "\n[STEP] Testing Uninstall (2)...\n"
send "2\r"
expect {
"y/n" { send "y\r"; exp_continue }
"按任意键继续" { send "\r" }
}
# 退出到主菜单
expect "选择:" { send "0\r" }
exp_continue
}
# 返回主菜单后退出
"0. 返回主菜单" {
send "0\r"
}
timeout {
send_user "\n[ERROR] Automation timeout for $app_id\n"
exit 1
}
}
expect eof
send_user "\n>>> SUCCESS: All lifecycle stages tested for $app_id <<<\n"