forked from vmware/vic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path26-01-Basic.robot
More file actions
163 lines (120 loc) · 7.26 KB
/
26-01-Basic.robot
File metadata and controls
163 lines (120 loc) · 7.26 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright 2018 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
*** Settings ***
Documentation Suite 26-01 - Basic
Resource ../../resources/Util.robot
Resource ../../resources/Group26-Storage-Quota-Util.robot
Suite Setup Install VIC Appliance To Test Server additional-args='--storage-quota=15'
Suite Teardown Cleanup VIC Appliance On Test Server
Test Timeout 30 minutes
*** Test Cases ***
Create a VCH with storage quota and docker info shows the storage quota and storage usage
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 15
Should Be Equal As Integers ${usageval} 0
Create a container and docker info shows the storage usage has changed
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -id ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 15
Should Be True ${usageval} > 9
Set Suite Variable ${pre_usage_val} ${usageval}
Pull a debian image and docker info shows the storage usage has changed
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull ${debian}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 15
Should Be True ${usageval} > ${pre_usage_val}
Set Suite Variable ${pre_usage_val} ${usageval}
Create second container and get storage quota exceeding failure
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -id ${busybox}
Should Be Equal As Integers ${rc} 125
Should Contain ${output} Storage quota exceeds
Configure VCH with a larger storage quota of 35GB
${output}= Run bin/vic-machine-linux configure --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --timeout %{TEST_TIMEOUT} --storage-quota 35
Should Contain ${output} Completed successfully
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Create second container successfully
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -id --name secondc ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be True ${usageval} > 18
Remove a container successfully with storage usage changes
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm -f secondc
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be Equal As Integers ${usageval} ${pre_usage_val}
Create a busybox container with memory of 4GB successfully
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -m=4g -id ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be True ${usageval} > 20
Create a debian container and commit to an image successfully
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d --name commit1 ${debian} tail -f /dev/null
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be True ${usageval} > 29
Set Suite Variable ${pre_usage_val} ${usageval}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec commit1 apt-get update
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec commit1 apt-get install nano -y
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop -t1 commit1
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} commit commit1 debian-nano
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be True ${usageval} > ${pre_usage_val}
Delete an image successfully with storage usage decreased
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rmi debian-nano
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
${limitval} ${usageval}= Get storage quota limit and usage ${output}
Should Be Equal As Integers ${limitval} 35
Should Be Equal As Integers ${usageval} ${pre_usage_val}
Create a busybox continainer afer unsetting storage quota
${output}= Run bin/vic-machine-linux configure --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --timeout %{TEST_TIMEOUT} --storage-quota 0
Should Contain ${output} Completed successfully
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -id ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} storage limit
${usageval}= Get storage usage ${output}
Should Be True ${usageval} > 38