Skip to content

Commit

Permalink
Change variables
Browse files Browse the repository at this point in the history
Signed-off-by: Mariia Azbeleva <[email protected]>
  • Loading branch information
azbeleva committed Nov 23, 2023
1 parent 7eacd4c commit 3a3ea1c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Robot-Framework/config/variables.robot
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Set Variables
Set Global Variable ${NETVM_NAME} net-vm
Set Global Variable ${NETVM_SERVICE} microvm@${NETVM_NAME}.service
Set Global Variable ${NETVM_IP} 192.168.101.1
Set Global Variable ${GUIVM_IP} 192.168.100.5
Set Global Variable ${CHROMIUM_VM_IP} 192.168.100.4
Set Global Variable ${GALAVM_IP} 192.168.100.3
Set Global Variable ${ZATHURAVM_IP} 192.168.100.2
Set Global Variable ${GUI_VM} gui-vm.ghaf
Set Global Variable ${CHROMIUM_VM} chromium-vm.ghaf
Set Global Variable ${GALA_VM} gala-vm.ghaf
Set Global Variable ${ZATHURA_VM} zathura-vm.ghaf


Read Config
Expand Down
28 changes: 14 additions & 14 deletions Robot-Framework/test-suites/bat-tests/apps.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Suite Teardown Close All Connections


*** Variables ***
${ghaf_host} ${EMPTY}
${netvm} ${EMPTY}
${guivm} ${EMPTY}
${ghaf_host_ssh} ${EMPTY}
${netvm_ssh} ${EMPTY}
${guivm_ssh} ${EMPTY}


*** Test Cases ***
Expand Down Expand Up @@ -43,7 +43,7 @@ Connect to ghaf host
[Documentation] Open ssh connection to ghaf host
Log To Console Connecting to Ghaf Host
${connection} Connect
Set Global Variable ${ghaf_host} ${connection}
Set Global Variable ${ghaf_host_ssh} ${connection}
[Return] ${connection}

Connect to netvm
Expand All @@ -52,22 +52,22 @@ Connect to netvm
... commands, like 'Execute Command'
Connect to ghaf host
Log To Console Connecting to NetVM
${connection} Open Connection ${NETVM_IP} port=22
${output} Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${ghaf_host}
Set Global Variable ${netvm} ${connection}
[Return] ${netvm}
${connection} Open Connection ${NETVM_IP} port=22
${output} Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${ghaf_host_ssh}
Set Global Variable ${netvm_ssh} ${connection}
[Return] ${netvm_ssh}

Connect to guivm
Log To Console Connecting to GuiVM
${connection}= Open Connection ${GUIVM_IP} port=22
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${netvm}
Set Global Variable ${guivm} ${connection}
[Return] ${guivm}
${connection}= Open Connection ${GUI_VM} port=22
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${netvm_ssh}
Set Global Variable ${guivm_ssh} ${connection}
[Return] ${guivm_ssh}

Connect to chromium vm
Log To Console Connecting to Chromium VM
${connection}= Open Connection ${CHROMIUM_VM_IP} port=22
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${netvm}
${connection}= Open Connection ${CHROMIUM_VM} port=22
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${netvm_ssh}
Set Global Variable ${chromium_vm} ${connection}
[Return] ${chromium_vm}

Expand Down
30 changes: 15 additions & 15 deletions Robot-Framework/test-suites/bat-tests/netvm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ${SSID} test_network
${wifi_pswd} test1234
${netwotk_ip} 192.168.1.1
${netvm_state} ${EMPTY}
${ghaf_host} ${EMPTY}
${netvm} ${EMPTY}
${ghaf_host_ssh} ${EMPTY}
${netvm_ssh} ${EMPTY}


*** Test Cases ***
Expand All @@ -37,11 +37,11 @@ Wifi passthrought into NetVM
[Setup] Run Keywords
... Connect to ghaf host AND Connect to netvm AND
... Verify service status service=wpa_supplicant.service
Configure wifi ${netvm} ${SSID} ${wifi_pswd}
Configure wifi ${netvm_ssh} ${SSID} ${wifi_pswd}
Get wifi IP
Check Network Availability ${netwotk_ip} expected_result=True
Log To Console Switch connection to Ghaf Host
Switch Connection ${ghaf_host}
Switch Connection ${ghaf_host_ssh}
Check Network Availability ${netwotk_ip} expected_result=False
[Teardown] Run Keywords Remove Wifi configuration AND Close All Connections

Expand All @@ -57,9 +57,9 @@ NetVM is wiped after restarting
[Tags] bat SP-T53 nuc orin-agx orin-nx lenovoX1
[Setup] Run Keywords
... Connect to ghaf host AND Connect to netvm
Switch Connection ${netvm}
Switch Connection ${netvm_ssh}
Create file /etc/test.txt
Switch Connection ${ghaf_host}
Switch Connection ${ghaf_host_ssh}
Restart NetVM
Close All Connections
Connect to ghaf host
Expand All @@ -74,7 +74,7 @@ Verify wpa_supplicant.service is running
[Tags] bat SP-T82 nuc orin-agx lenovoX1
[Setup] Run Keywords
... Connect to ghaf host AND Connect to netvm
Switch Connection ${netvm}
Switch Connection ${netvm_ssh}
Verify service status service=wpa_supplicant.service
[Teardown] Run Keywords Close All Connections

Expand All @@ -83,7 +83,7 @@ Verify NetVM PCI device passthrough
[Tags] bat SP-T101 nuc orin-agx orin-nx
[Setup] Run Keywords
... Connect to ghaf host AND Connect to netvm
Verify microvm PCI device passthrough host_connection=${ghaf_host} vm_connection=${netvm} vmname=${NETVM_NAME}
Verify microvm PCI device passthrough host_connection=${ghaf_host_ssh} vm_connection=${netvm_ssh} vmname=${NETVM_NAME}
[Teardown] Run Keywords Close All Connections


Expand All @@ -101,7 +101,7 @@ Restart NetVM
Connect to ghaf host
[Documentation] Open ssh connection to ghaf host
${connection}= Connect
Set Global Variable ${ghaf_host} ${connection}
Set Global Variable ${ghaf_host_ssh} ${connection}
[Return] ${connection}

Connect to netvm
Expand All @@ -110,19 +110,19 @@ Connect to netvm
... commands, like 'Execute Command'
Log To Console Connecting to NetVM
${connection}= Open Connection ${NETVM_IP} port=22
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${ghaf_host}
Set Global Variable ${netvm} ${connection}
[Return] ${netvm}
${output}= Login username=${LOGIN} password=${PASSWORD} jumphost_index_or_alias=${ghaf_host_ssh}
Set Global Variable ${netvm_ssh} ${connection}
[Return] ${netvm_ssh}

Configure wifi
[Arguments] ${netvm} ${SSID} ${passw}
Switch Connection ${netvm}
[Arguments] ${netvm_ssh} ${SSID} ${passw}
Switch Connection ${netvm_ssh}
Log To Console Configuring Wifi
Execute Command sh -c "wpa_passphrase ${SSID} ${passw} > /etc/wpa_supplicant.conf" sudo=True sudo_password=${PASSWORD}
Execute Command systemctl restart wpa_supplicant.service sudo=True sudo_password=${PASSWORD}

Remove Wifi configuration
Switch Connection ${netvm}
Switch Connection ${netvm_ssh}
Log To Console Removing Wifi configuration
Execute Command rm /etc/wpa_supplicant.conf sudo=True sudo_password=${PASSWORD}
Execute Command systemctl restart wpa_supplicant.service sudo=True sudo_password=${PASSWORD}
Expand Down

0 comments on commit 3a3ea1c

Please sign in to comment.