Skip to content

Commit fbfc7a3

Browse files
committed
dts-e2e: add credentials and UI footer tests
Signed-off-by: Michał Iwanicki <[email protected]>
1 parent 52cfe9e commit fbfc7a3

File tree

1 file changed

+255
-5
lines changed

1 file changed

+255
-5
lines changed

dts/dts-e2e.robot

Lines changed: 255 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,261 @@ E2E003.002 DCR UEFI Update On Msi-pro-z690-a-wifi-ddr4 With 13th Gen CPU Should
7777
# Credentials tests:
7878
################################################################################
7979

80-
E2E007.001 QEMU Check credentials are being saved correctly
81-
E2E007.002 QEMU Check old credentials are being overwritten by new
82-
E2E007.003 QEMU Check wrong credentials should not allow to log into DPP services
83-
E2E007.004 QEMU Check correct credentials should allow to log into DPP services
84-
E2E007.005 QEMU Check empty credentials should not pass
80+
E2E007.001 Check credentials are being saved correctly
81+
[Documentation] Check that credentials are saved to /etc/cloud-pass and
82+
... to mc correctly
83+
Clean Up DTS Environment
84+
Execute Command In Terminal export DTS_TESTING="true"
85+
Write Into Terminal dts-boot
86+
87+
Provide DPP Credentials
88+
Wait For Checkpoint ${DTS_CHECKPOINT}
89+
Enter Shell In DTS
90+
${creds}= Execute Command In Terminal cat /etc/cloud-pass
91+
@{lines}= Split To Lines ${creds}
92+
${line_num}= Get Length ${lines}
93+
Should Be Equal As Integers ${line_num} 2 cloud-pass file should have only 2 lines
94+
IF "${lines}[0]" != "${DPP_EMAIL}" or "${lines}[1]" != "${DPP_PASSWORD}"
95+
Fail E-mail or password is different from expected
96+
END
97+
${creds2}= Execute Command In Terminal mc alias ls premium | grep "Key" | awk '{print $3}'
98+
Should Be Equal ${creds} ${creds2}
99+
... /etc/cloud-pass and mc credentials differ
100+
101+
E2E007.002 Check old credentials are being overwritten by new
102+
[Documentation] Make sure that entering new credentials results in old
103+
... being overwritten. Requires 2 sets of working credentials as mc
104+
... doesn't save credentials that do not work.
105+
Depends On Variable \${DPP_EMAIL_FW_ONLY}
106+
Depends On Variable \${DPP_PASSWORD_FW_ONLY}
107+
Clean Up DTS Environment
108+
Execute Command In Terminal export DTS_TESTING="true"
109+
Write Into Terminal dts-boot
110+
111+
Provide DPP Credentials
112+
VAR ${DPP_EMAIL}= ${DPP_EMAIL_FW_ONLY} scope=TEST
113+
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_FW_ONLY} scope=TEST
114+
Provide DPP Credentials
115+
Wait For Checkpoint ${DTS_CHECKPOINT}
116+
Enter Shell In DTS
117+
118+
${creds}= Execute Command In Terminal cat /etc/cloud-pass
119+
@{lines}= Split To Lines ${creds}
120+
${line_num}= Get Length ${lines}
121+
Should Be Equal As Integers ${line_num} 2 cloud-pass file should have only 2 lines
122+
IF "${lines}[0]" != "${DPP_EMAIL_FW_ONLY}" or "${lines}[1]" != "${DPP_PASSWORD_FW_ONLY}"
123+
Fail E-mail or password is different from expected
124+
END
125+
${creds2}= Execute Command In Terminal mc alias ls premium | grep "Key" | awk '{print $3}'
126+
Should Be Equal ${creds} ${creds2}
127+
... /etc/cloud-pass and mc credentials differ
128+
129+
E2E007.003 Check wrong credentials should not allow to log into DPP services
130+
[Documentation] Entering wrong credentials shouldn't allow access to DPP
131+
... services and shouldn't be saved
132+
Clean Up DTS Environment
133+
Execute Command In Terminal export DTS_TESTING="true"
134+
Write Into Terminal dts-boot
135+
136+
VAR ${DPP_EMAIL}= [email protected] scope=TEST
137+
VAR ${DPP_PASSWORD}= test-password scope=TEST
138+
${out}= Provide DPP Credentials
139+
Should Contain ${out} Cannot log in to DPP server.
140+
Should Not Contain ${out} Dasharo DPP credentials have been saved
141+
Wait For Checkpoint ${DTS_CHECKPOINT}
142+
Enter Shell In DTS
143+
${creds}= Execute Command In Terminal cat /etc/cloud-pass
144+
Should Not Contain Any ${creds} ${DPP_EMAIL} ${DPP_PASSWORD}
145+
${creds2}= Execute Command In Terminal
146+
... mc alias ls premium | grep "Key" | awk '{print $3}'
147+
Should Not Contain Any ${creds2} ${DPP_EMAIL} ${DPP_PASSWORD}
148+
149+
E2E007.004 Check correct credentials should allow to log into DPP services
150+
[Documentation] Entering correct credentials should allow access to DPP
151+
... services
152+
Clean Up DTS Environment
153+
# We need to simulate supported platform
154+
Export Shell Variables For Emulation
155+
... UEFI Update
156+
... DPP
157+
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus]
158+
... ${DTS_CONFIG_REF}
159+
Write Into Terminal dts-boot
160+
161+
${out}= Provide DPP Credentials
162+
Should Contain ${out} Dasharo Pro Package (DPP): YES
163+
Wait For Checkpoint ${DTS_CHECKPOINT}
164+
Enter Shell In DTS
165+
${rc}= Execute Command In Terminal And Return RC mc ls premium
166+
Should Be Equal As Integers ${rc} 0
167+
... mc command failed to list buckets
168+
169+
E2E007.005 Check empty e-mail should not pass
170+
[Documentation] Entering empty e-mail shouldn't be allowed
171+
Clean Up DTS Environment
172+
Write Into Terminal dts-boot
173+
${out}= Read From Terminal Until ${DTS_CHECKPOINT}
174+
Write Bare Into Terminal ${DTS_CREDENTIALS_OPT}
175+
Wait For Checkpoint And Press Enter ${DPP_EMAIL_CHECKPOINT}
176+
Set DUT Response Timeout 15s
177+
Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT}
178+
Wait For Checkpoint ${DTS_CHECKPOINT}
179+
Enter Shell In DTS
180+
${lines}= Execute Command In Terminal
181+
... cat /etc/cloud-pass 2>/dev/null | wc -l
182+
Should Be Equal As Integers ${lines} 0 cloud-pass shouldn't exist or at least be empty
183+
184+
E2E007.006 Check empty password should not pass
185+
[Documentation] Entering empty password shouldn't be allowed
186+
Clean Up DTS Environment
187+
Write Into Terminal dts-boot
188+
${out}= Read From Terminal Until ${DTS_CHECKPOINT}
189+
Write Bare Into Terminal ${DTS_CREDENTIALS_OPT}
190+
Wait For Checkpoint And Write ${DPP_EMAIL_CHECKPOINT} ${DPP_EMAIL}
191+
Wait For Checkpoint And Press Enter ${DPP_PASSWORD_CHECKPOINT}
192+
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT}
193+
Should Not Contain ${out} Dasharo Pro Package (DPP):
194+
Wait For Checkpoint ${DTS_CHECKPOINT}
195+
Enter Shell In DTS
196+
${lines}= Execute Command In Terminal
197+
... cat /etc/cloud-pass 2>/dev/null | wc -l
198+
Should Be Equal As Integers ${lines} 0 cloud-pass shouldn't exist or at least be empty
199+
200+
E2E007.008 Check DPP credentials with access to only firmware
201+
[Documentation] Those credentials should allow access only to DPP
202+
... firmware
203+
Depends On Variable \${DPP_EMAIL_FW_ONLY}
204+
Depends On Variable \${DPP_PASSWORD_FW_ONLY}
205+
Clean Up DTS Environment
206+
Export Shell Variables For Emulation
207+
... UEFI Update
208+
... DPP
209+
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus]
210+
... ${DTS_CONFIG_REF}
211+
Write Into Terminal dts-boot
212+
213+
VAR ${DPP_EMAIL}= ${DPP_EMAIL_FW_ONLY} scope=TEST
214+
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_FW_ONLY} scope=TEST
215+
${out}= Provide DPP Credentials
216+
Should Contain ${out} Dasharo Pro Package (DPP): YES
217+
Should Contain ${out} DTS Extensions: NO
218+
219+
E2E007.009 Check DPP credentials with access to only extensions
220+
[Documentation] Those credentials should allow access only to DTS
221+
... extensions
222+
Depends On Variable \${DPP_EMAIL_EXTENSIONS_ONLY}
223+
Depends On Variable \${DPP_PASSWORD_EXTENSIONS_ONLY}
224+
Clean Up DTS Environment
225+
Export Shell Variables For Emulation
226+
... UEFI Update
227+
... DPP
228+
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus]
229+
... ${DTS_CONFIG_REF}
230+
Write Into Terminal dts-boot
231+
232+
VAR ${DPP_EMAIL}= ${DPP_EMAIL_EXTENSIONS_ONLY} scope=TEST
233+
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_EXTENSIONS_ONLY} scope=TEST
234+
${out}= Provide DPP Credentials
235+
Should Contain ${out} Dasharo Pro Package (DPP): NO
236+
Should Contain ${out} DTS Extensions: YES
237+
238+
E2E007.010 Check DPP credentials without DPP access
239+
[Documentation] Those credentials shouldn't allow access to any firmware
240+
... or DTS extensions
241+
Depends On Variable \${DPP_EMAIL_NO_ACCESS}
242+
Depends On Variable \${DPP_PASSWORD_NO_ACCESS}
243+
Clean Up DTS Environment
244+
Export Shell Variables For Emulation
245+
... UEFI Update
246+
... DPP
247+
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus]
248+
... ${DTS_CONFIG_REF}
249+
Write Into Terminal dts-boot
250+
251+
VAR ${DPP_EMAIL}= ${DPP_EMAIL_NO_ACCESS} scope=TEST
252+
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_NO_ACCESS} scope=TEST
253+
${out}= Provide DPP Credentials
254+
Should Contain ${out} Something may be wrong with the DPP credentials
255+
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT}
256+
Should Contain ${out} Dasharo Pro Package (DPP): NO
257+
Should Contain ${out} DTS Extensions: NO
258+
259+
E2E007.011 Check DPP credentials with both DPP firmware and DTS extensions access
260+
[Documentation] Those credentials should allow access to both DPP
261+
... firmware and DTS extensions
262+
Clean Up DTS Environment
263+
Export Shell Variables For Emulation
264+
... UEFI Update
265+
... DPP
266+
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus]
267+
... ${DTS_CONFIG_REF}
268+
Write Into Terminal dts-boot
269+
270+
${out}= Provide DPP Credentials
271+
Should Contain ${out} Dasharo Pro Package (DPP): YES
272+
Should Contain ${out} DTS Extensions: YES
273+
274+
E2E008.001 Reboot UI Option Calls Reboot Command
275+
[Documentation] Reboot (R) UI option should call mocked reboot command
276+
Clean Up DTS Environment
277+
Execute Command In Terminal export DTS_TESTING="true"
278+
Write Into Terminal dts-boot
279+
Wait For Checkpoint ${DTS_CHECKPOINT}
280+
Write Bare Into Terminal R
281+
Wait For Checkpoint common_mock: using reboot
282+
283+
E2E008.002 Poweroff UI Option Calls Poweroff Command
284+
[Documentation] Poweroff (P) UI option should call mocked poweroff
285+
Clean Up DTS Environment
286+
Execute Command In Terminal export DTS_TESTING="true"
287+
Write Into Terminal dts-boot
288+
Wait For Checkpoint ${DTS_CHECKPOINT}
289+
Write Bare Into Terminal P
290+
Wait For Checkpoint common_mock: using poweroff
291+
292+
E2E008.003 Launch SSH Server UI Option Enables SSH Server Command
293+
[Documentation] Launch SSH Server (K) UI option should start sshd server
294+
Clean Up DTS Environment
295+
Execute Command In Terminal export DTS_TESTING="true"
296+
Execute Command In Terminal systemctl stop sshd
297+
Write Into Terminal dts-boot
298+
${out}= Wait For Checkpoint ${DTS_CHECKPOINT}
299+
Should Not Contain ${out} SSH status: ON
300+
Write Bare Into Terminal K
301+
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT}
302+
Should Contain All ${out} Starting SSH server! Listening on IPs
303+
${out}= Wait For Checkpoint ${DTS_CHECKPOINT}
304+
Should Contain ${out} SSH status: ON
305+
306+
E2E008.004 Enable Sending Logs UI Option Should Enable DTS Log Sending
307+
[Documentation] Enable Sending DTS Logs (L) should enable automatic log
308+
... sending e.g. when entering shell
309+
Clean Up DTS Environment
310+
Execute Command In Terminal export DTS_TESTING="true"
311+
Write Into Terminal dts-boot
312+
${out}= Wait For Checkpoint ${DTS_CHECKPOINT}
313+
Should Contain ${out} L to enable
314+
Write Bare Into Terminal L
315+
${out}= Wait For Checkpoint ${DTS_CHECKPOINT}
316+
Should Contain ${out} L to disable
317+
Write Bare Into Terminal S
318+
SSHLibrary.Read Until Sending logs...
319+
320+
E2E009.001 DTS extensions are installed and can be used
321+
[Documentation] Test that DTS extensions are installed after entering DPP
322+
... keys with access to them and that they can be used after.
323+
Clean Up DTS Environment
324+
Execute Command In Terminal export DTS_TESTING="true"
325+
Write Into Terminal dts-boot
326+
327+
${out}= Provide DPP Credentials
328+
Should Contain ${out}
329+
... Package txeconfigtool-git-r0.core2_64.rpm have been installed successfully!
330+
Wait For Checkpoint ${DTS_CHECKPOINT}
331+
Enter Shell In DTS
332+
${rc}= Execute Command In Terminal And Return RC command -V txeconfigtool
333+
Should Be Equal As Integers ${rc} 0 txeconfigtool can't be found
334+
85335

86336
*** Keywords ***
87337
# robocop: disable:0919

0 commit comments

Comments
 (0)