3 Resource Variables.robot
4 Resource ../../../../libraries/Utils.robot
5 Resource ../../../../libraries/GBP/ConnUtils.robot
6 Variables ../../../../variables/Variables.py
11 [Documentation] Configures underlying infrastructure composed of Docker containers and OVS switches on remote VM.
12 ... Python and Bash scripts are used.
13 [Arguments] ${GBPSFC} ${sw_index} ${suite_dir} ${timeout}=10s
14 ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout}
15 SSHLibrary.Put File ${suite_dir}/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755
16 ${stdout} ${stderr} ${rc} Execute in VE
17 ... python ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_launch.py ${ODL} ${sw_index}
18 ... timeout=${timeout}
19 Should Be Equal As Numbers ${rc} 0
20 ${stderr} Set Variable
21 # Flows for GBPSFC3 and GBPSFC5 have to be written manually.
22 # GBPSFC2 is SFF for GBPSFC3 and GBPSFC4 is SFF for GBPSFC5
23 IF "${GBPSFC}" == "${GBPSFC3}"
24 Write SF Flows ${GBPSFC2} ${stderr}
25 ELSE IF "${GBPSFC}" == "${GBPSFC5}"
26 Write SF Flows ${GBPSFC4} ${stderr}
28 Should Be Empty ${stderr}
29 SSHLibrary.Close Connection
32 [Documentation] Writes flows to SF node. SFF for given SF has to be specified in arguments.
33 [Arguments] ${SFF} ${stderr}
34 ${stderr} SSHLibrary.Execute Command
35 ... ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/sf-flows.sh ${SFF}
36 ... return_stderr=True
37 ... return_stdout=False
40 [Documentation] Clears underlying infrastructure composed of Docker containers and OVS switches from remote VM.
41 ... Python and Bash scripts are used.
42 [Arguments] ${GBPSFC} ${suite_dir} ${timeout}=3s
43 ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout}
44 ${stderr} SSHLibrary.Execute Command
45 ... rm ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_config.py
46 ... return_stderr=True
47 ... return_stdout=False
48 Should Be Empty ${stderr}
49 ${stderr} SSHLibrary.Execute Command
50 ... rm ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/sf-flows.sh
51 ... return_stderr=True
52 ... return_stdout=False
53 Should Be Empty ${stderr}
54 ${stderr} SSHLibrary.Execute Command
55 ... ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/clean-demo.sh
56 ... return_stderr=True
57 ... return_stdout=False
58 Should Be Empty ${stderr}
59 SSHLibrary.Close Connection
62 [Arguments] ${GBPSFCs} ${init_scripts_dir}
63 ${sw_index} Set Variable 0
64 FOR ${GBPSFC} IN @{GBPSFCs}
65 Setup Node ${GBPSFC} ${sw_index} ${init_scripts_dir} timeout=10s
66 ${sw_index} Evaluate ${sw_index} + 1