blob: 973f26f280d889ff2747db89117670057062baa6 [file] [log] [blame]
shrsuman1234f0bcbe2021-08-31 04:05:57 -05001*** Settings ***
2
3Documentation VMI multiple network interface tests.
4
5# This includes test scenarios where VMI has multiple interfaces.
6# So,assigns and verifies the combination of network mode in interfaces.
7
8Resource ../../lib/external_intf/vmi_utils.robot
9
10Suite Setup Suite Setup Execution
George Keishing4e0978d2022-07-27 10:21:18 -050011Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution
shrsuman1234f0bcbe2021-08-31 04:05:57 -050012
Matt Fischer6fb70d92023-10-24 19:06:33 -060013Test Tags Vmi_Multiple_Interfaces
George Keishing725e0662022-07-20 22:18:14 -050014
shrsuman1234f0bcbe2021-08-31 04:05:57 -050015*** Variables ***
16
17${test_ipv4_1} 10.6.6.6
18${test_gateway_1} 10.6.6.1
19${test_netmask_1} 255.255.252.0
20
21${test_ipv4_2} 10.5.20.5
22${test_gateway_2} 10.5.20.1
23${test_netmask_2} 255.255.255.0
24${test_ipv4_3} 10.6.4.6
25
26*** Test Cases ***
27
28Configure VMI Both Interfaces In Same Subnet And Verify
29 [Documentation] Configure VMI both interfaces in same subnet and verify.
30 [Tags] Configure_VMI_Both_Interfaces_In_Same_Subnet_And_Verify
31 [Teardown] Test Teardown Execution
32
33 Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1}
34 ... ${test_netmask_1}
35 Set Static IPv4 Address To VMI And Verify ${test_ipv4_3} ${test_gateway_1}
36 ... ${test_netmask_1} ${HTTP_ACCEPTED} ${interface_list}[1]
37
38Configure VMI Both Interfaces In Different Subnet And Verify
39 [Documentation] Configure VMI both interfaces in different subnet and verify.
40 [Tags] Configure_VMI_Both_Interfaces_In_Different_Subnet_And_Verify
41 [Teardown] Test Teardown Execution
42
43 Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1}
44 ... ${test_netmask_1}
45 Set Static IPv4 Address To VMI And Verify ${test_ipv4_2} ${test_gateway_2}
46 ... ${test_netmask_2} ${HTTP_ACCEPTED} ${interface_list}[1]
47
shrsuman123445eccc2021-10-12 04:10:05 -050048Configure VMI Both Interfaces In Dynamic And Verify
49 [Documentation] Configure VMI both interfaces in dynamic And Verify.
50 [Tags] Configure_VMI_Both_Interfaces_In_Dynamic_And_Verify
51 [Teardown] Run keywords Set VMI IPv4 Origin ${False}
52 ... AND Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} ${interface_list}[1]
Megha G N0f151252024-04-16 02:27:07 -050053 ... AND Test Teardown Execution
shrsuman123445eccc2021-10-12 04:10:05 -050054
55 Set VMI IPv4 Origin ${True}
56 ${default}= Set Variable 0.0.0.0
57 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} ${interface_list}[1]
58 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
59 Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${interface_list}[1]
60
shrsuman1237e9b2122021-09-28 06:06:16 -050061Configure VMI First Interface In Static And Second In Dynamic And Verify
62 [Documentation] Configure VMI first interface in static mode and second interface in dynamic mode
63 ... and verify first gets static ip details and second gets dynamic ip details.
64 [Tags] Configure_VMI_First_Interface_In_Static_And_Second_In_Dynamic_And_Verify
65 [Teardown] Run keywords Delete VMI IPv4 Address AND
66 ... Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} ${interface_list}[1]
Megha G N0f151252024-04-16 02:27:07 -050067 ... AND Test Teardown Execution
shrsuman1237e9b2122021-09-28 06:06:16 -050068
69 Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1}
70 ... ${test_netmask_1}
71 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} ${interface_list}[1]
72 ${default}= Set Variable 0.0.0.0
73 Verify VMI Network Interface Details ${test_ipv4_1} Static ${test_gateway_1} ${test_netmask_1}
74 Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${interface_list}[1]
75
76Configure VMI First Interface In Dynamic And Second In Static And Verify
77 [Documentation] Configure VMI first interface in dynamic mode and second interface in static mode
78 ... and verify first gets dynamic ip details and second gets static ip details.
79 [Tags] Configure_VMI_First_Interface_In_Dynamic_And_Second_In_Static_And_Verify
80 [Teardown] Run keywords Set VMI IPv4 Origin ${False} AND
81 ... Delete VMI IPv4 Address IPv4StaticAddresses ${HTTP_ACCEPTED} ${interface_list}[1]
Megha G N0f151252024-04-16 02:27:07 -050082 ... AND Test Teardown Execution
shrsuman1237e9b2122021-09-28 06:06:16 -050083
84 Set VMI IPv4 Origin ${True}
85 ${default}= Set Variable 0.0.0.0
86 Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1}
87 ... ${test_netmask_1} ${HTTP_ACCEPTED} ${interface_list}[1]
88 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
89
shrsuman1234f0bcbe2021-08-31 04:05:57 -050090*** Keywords ***
91
92Suite Setup Execution
93 [Documentation] Do suite setup execution task.
94
95 Redfish.Login
96 Redfish Power On stack_mode=skip quiet=1
97 Get Original Vmi Details
98
99
100Test Teardown Execution
101 [Documentation] Do test teardown execution task.
102
103 FOR ${interface} IN @{interface_list}
104 Delete VMI IPv4 Address IPv4StaticAddresses ${HTTP_ACCEPTED} ${interface}
105 END
106
107 FFDC On Test Case Fail
108
109
110Get Original Vmi Details
111 [Documentation] Get original details of VMI.
112
113 @{interface_list}= Get VMI Interfaces
114 Set Suite Variable @{interface_list}
115
116 FOR ${interface} IN @{interface_list}
117 ${resp}= Redfish.Get
118 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
119 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
120 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
121 ${vmi_network_conf}= Catenate SEPARATOR=_ vmi_network_conf ${interface}
122 ${vmi_network_conf_value}= Run Keyword If ${length} != ${0}
123 ... Get VMI Network Interface Details ${interface}
124 Set Suite Variable ${${vmi_network_conf}} ${vmi_network_conf_value}
125 END
126
127
128Suite Teardown Execution
129 [Documentation] Do suite teardown execution task
130 ... Set original vmi details and verify.
131
132 FOR ${interface} IN @{interface_list}
133 Run Keyword If ${vmi_network_conf_${interface}} != ${None}
134 ... Set Static IPv4 Address To VMI And Verify
135 ... ${vmi_network_conf_${interface}}[IPv4_Address]
136 ... ${vmi_network_conf_${interface}}[IPv4_Gateway]
137 ... ${vmi_network_conf_${interface}}[IPv4_SubnetMask]
138 ... ${HTTP_ACCEPTED} ${interface}
139 END
140
141 Redfish.Logout
142