-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcli_sample_usage.sh
executable file
·69 lines (47 loc) · 1.5 KB
/
cli_sample_usage.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
function dm () {
python3 -m dapp_manager "$@"
}
echo "1. Current apps"
dm list
echo "What about app 'no_such_app'?"
dm read state no_such_app
echo "Exit code: $?"
APP_ID_1=$(DAPP_RUNNER_EXEC=tests/assets/mock_dapp_runner.py dm start --config ttt.yml zzz.yml)
echo "2. Started app $APP_ID_1"
echo "3. Current apps"
dm list
APP_ID_2=$(DAPP_RUNNER_EXEC=tests/assets/mock_dapp_runner.py dm start --config ttt.yml zzz.yml)
echo "4. Started app $APP_ID_2"
echo "5. Current apps"
dm list
sleep 1
echo "6. Print state file for $APP_ID_1"
dm read state $APP_ID_1
echo "7. Print data file for $APP_ID_1"
dm read data $APP_ID_1
sleep 2
echo "8. Print state file for $APP_ID_1"
dm read state $APP_ID_1
echo "9. Print data file for $APP_ID_1"
dm read data $APP_ID_1
echo "10. Print data file for $APP_ID_2"
dm read data $APP_ID_2
echo "11. Stopping $APP_ID_1 with default timeout (should succeed -> app_id printed)"
dm stop $APP_ID_1
echo "12. Stopping $APP_ID_2 with short timeout (should fail -> no print)"
dm stop --timeout 1 $APP_ID_2
echo "13. Killing $APP_ID_2"
dm kill $APP_ID_2
echo "14. Check read state of $APP_ID_1 without --no-ensure-alive"
dm read state $APP_ID_1
echo "Exit code: $?"
echo "15. Check read state of $APP_ID_1 with --no-ensure-alive"
dm read state --no-ensure-alive $APP_ID_1
echo "16. Check read state of $APP_ID_2 with --no-ensure-alive"
dm read state --no-ensure-alive $APP_ID_2
echo "17. Check app list again"
dm list
echo "18. Prune dead apps"
dm prune
echo "19. Check the list again"
dm list