[VOL-4355] Fixed hardcoded namespace values
Change-Id: I90894ab10ddcb57d9b59123479240fc9c3c7d967
diff --git a/tests/openonu-go-adapter/Voltha_ONUFlowChecks.robot b/tests/openonu-go-adapter/Voltha_ONUFlowChecks.robot
index 8bccdc4..ad700d2 100755
--- a/tests/openonu-go-adapter/Voltha_ONUFlowChecks.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUFlowChecks.robot
@@ -35,7 +35,8 @@
Resource ../../libraries/onu_utilities.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 60s
${of_id} 0
${logical_id} 0
@@ -107,8 +108,8 @@
${techprofile}= Set Variable If "${techprofile}"=="1T1GEM" default ${techprofile}
Set Suite Variable ${techprofile}
Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default (1T1GEM)
- ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM
- ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM
+ ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM ${INFRA_NAMESPACE}
+ ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM ${INFRA_NAMESPACE}
... ELSE Fail The TechProfile (${techprofile}) is not valid!
${switch_type}= Get Variable Value ${web_power_switch.type}
Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
@@ -126,17 +127,18 @@
Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
Run Keyword If ${teardown_device} Delete All Devices and Verify
- Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
+ Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix}
+ ... without_pm_data=False
Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout}
Close All ONOS SSH Connections
- Remove Tech Profile
+ Remove Tech Profile ${INFRA_NAMESPACE}
Validate Etcd Vlan Rules Added Subscriber
[Documentation] This keyword validates Vlan rules of openonu-go-adapter Data stored in etcd.
... It checks the match_vid (=4096) and set_vid when subscriber are added.
[Arguments] ${onu_tags_dict} ${reqmatchvid}=4096 ${defaultkvstoreprefix}=voltha_voltha
${kvstoreprefix}= Get Kv Store Prefix ${defaultkvstoreprefix}
- ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix} True True
+ ${etcddata}= Get ONU Go Adapter ETCD Data ${INFRA_NAMESPACE} ${kvstoreprefix} True True
#prepare result for json convert
${result}= Prepare ONU Go Adapter ETCD Data For Json ${etcddata}
${jsondata}= To Json ${result}
@@ -178,7 +180,7 @@
... It checks the match_vid (=4096) and set_vid when subscriber are removed.
[Arguments] ${reqmatchvid}=4096 ${defaultkvstoreprefix}=voltha_voltha
${kvstoreprefix}= Get Kv Store Prefix ${defaultkvstoreprefix}
- ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix} True True
+ ${etcddata}= Get ONU Go Adapter ETCD Data ${INFRA_NAMESPACE} ${kvstoreprefix} True True
#prepare result for json convert
${result}= Prepare ONU Go Adapter ETCD Data For Json ${etcddata}
${jsondata}= To Json ${result}
diff --git a/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot b/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
index 1a2ebf7..07a44c9 100755
--- a/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
@@ -34,7 +34,8 @@
Resource ../../variables/variables.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 300s
${of_id} 0
${logical_id} 0
@@ -101,13 +102,13 @@
${techprofile}= Set Variable If "${techprofile}"=="1T1GEM" default ${techprofile}
Set Suite Variable ${techprofile}
Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default (1T1GEM)
- ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM
- ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM
+ ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM ${INFRA_NAMESPACE}
+ ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM ${INFRA_NAMESPACE}
... ELSE Fail The TechProfile (${techprofile}) is not valid!
# delete etcd MIB Template Data
- Delete MIB Template Data
+ Delete MIB Template Data ${INFRA_NAMESPACE}
# delete etcd onu data
- Delete ONU Go Adapter ETCD Data validate=True
+ Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True
Teardown Suite
[Documentation] Replaces the Suite Teardown in utils.robot.
@@ -117,7 +118,8 @@
Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
Run Keyword If ${teardown_device} Delete All Devices and Verify
- Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
+ Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix}
+ ... without_pm_data=False
Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout}
Close All ONOS SSH Connections
- Remove Tech Profile
+ Remove Tech Profile ${INFRA_NAMESPACE}
diff --git a/tests/openonu-go-adapter/Voltha_ONUOmciGetTest.robot b/tests/openonu-go-adapter/Voltha_ONUOmciGetTest.robot
index 4c4953a..e401f11 100755
--- a/tests/openonu-go-adapter/Voltha_ONUOmciGetTest.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUOmciGetTest.robot
@@ -34,7 +34,8 @@
Resource ../../libraries/power_switch.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 60s
${of_id} 0
${logical_id} 0
diff --git a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
index 3b34d8f..4198f98 100755
--- a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
@@ -38,7 +38,8 @@
Resource ../../variables/variables.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 60s
${of_id} 0
${logical_id} 0
@@ -177,9 +178,9 @@
Log ${LogInfo} console=yes
Common Test Suite Setup
# delete etcd MIB Template Data
- Delete MIB Template Data
+ Delete MIB Template Data ${INFRA_NAMESPACE}
# delete etcd onu data
- Delete ONU Go Adapter ETCD Data validate=True
+ Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True
Teardown Suite
@@ -190,9 +191,9 @@
Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
Run Keyword If ${teardown_device} Delete All Devices and Verify
- Run Keyword If ${usekill2restart} Restart Pod By Label ${namespace} app adapter-open-onu
+ Run Keyword If ${usekill2restart} Restart Pod By Label ${NAMESPACE} app adapter-open-onu
Run Keyword Unless ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s
- ... Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
+ ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False
Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout}
Close All ONOS SSH Connections
@@ -205,7 +206,7 @@
Run Keyword If ${has_dataplane} Sleep 60s
#restart open-onu pod to reset crash loop back off mechansim of kubenetes
Run Keyword If "${firsttest}"=="False" and "${usekill2restart}"=="True"
- ... Restart Pod By Label ${namespace} app adapter-open-onu
+ ... Restart Pod By Label ${NAMESPACE} app adapter-open-onu
Run Keyword If "${firsttest}"=="False" Sleep 35s
${firsttest} Set Variable False
Set Suite Variable ${firsttest}
@@ -238,7 +239,7 @@
Delete MIB Template Data
# check etcd data are empty
Run Keyword If ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s
- ... Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
+ ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False
Sleep 5s
Do Reconcile In Determined State
@@ -262,8 +263,8 @@
Enable Device ${olt_device_id}
END
Current State Test All Onus ${expected_onu_reason}
- Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${namespace}
- ... ELSE Restart And Check Onu Adaptor ${namespace}
+ Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${NAMESPACE}
+ ... ELSE Restart And Check Onu Adaptor ${NAMESPACE}
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
... ELSE Perform Sanity Test
@@ -297,8 +298,8 @@
Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock
... ELSE IF "${workflow}"=="TT" Current State Test All Onus omci-admin-lock
... ELSE Current State Test All Onus omci-admin-lock alternativeonustate=${alternativeonustates}
- Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${namespace}
- ... ELSE Restart And Check Onu Adaptor ${namespace}
+ Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${NAMESPACE}
+ ... ELSE Restart And Check Onu Adaptor ${NAMESPACE}
Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock
... ELSE IF "${workflow}"=="TT" Current State Test All Onus omci-admin-lock
... ELSE Current State Test All Onus omci-admin-lock alternativeonustate=${alternativeonustates}
@@ -331,8 +332,8 @@
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
... ELSE Perform Sanity Test
- Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${namespace}
- ... ELSE Restart And Check Onu Adaptor ${namespace}
+ Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${NAMESPACE}
+ ... ELSE Restart And Check Onu Adaptor ${NAMESPACE}
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
... ELSE Perform Sanity Test ${suppressaddsubscriber}
diff --git a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
index 9f085d1..8001c96 100755
--- a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
@@ -34,7 +34,8 @@
Resource ../../variables/variables.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 60s
${of_id} 0
${logical_id} 0
@@ -109,7 +110,7 @@
[Tags] functionalOnuGo CheckTechProfileOnuGo
[Setup] Start Logging ONUCheckTechProfile
Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed'
- ... Do Check Tech Profile
+ ... Do Check Tech Profile ${INFRA_NAMESPACE}
... ELSE Pass Execution ${skip_message} skipped
[Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
... AND Stop Logging ONUCheckTechProfile
@@ -163,7 +164,7 @@
[Tags] functionalOnuGo PowerOffPowerOnOnuGo
[Setup] Start Logging PowerOffPowerOnONUDevice
Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed'
- ... Do Power Off Power On Onu Device
+ ... Do Power Off Power On Onu Device ${NAMESPACE}
... ELSE Pass Execution ${skip_message} skipped
[Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
... AND Stop Logging PowerOffPowerOnONUDevice
@@ -200,8 +201,8 @@
${techprofile}= Set Variable If "${techprofile}"=="1T1GEM" default ${techprofile}
Set Suite Variable ${techprofile}
Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default (1T1GEM)
- ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM
- ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM
+ ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM ${INFRA_NAMESPACE}
+ ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM ${INFRA_NAMESPACE}
... ELSE Fail The TechProfile (${techprofile}) is not valid!
# map the passed onu state to reached and make it visible for test suite
${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}=
@@ -212,9 +213,9 @@
Set Suite Variable ${onu_state_nb}
Set Suite Variable ${onu_state}
# delete etcd MIB Template Data
- Delete MIB Template Data
+ Delete MIB Template Data ${INFRA_NAMESPACE}
# delete etcd onu data
- Delete ONU Go Adapter ETCD Data validate=True
+ Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True
Teardown Suite
[Documentation] Replaces the Suite Teardown in utils.robot.
@@ -224,10 +225,11 @@
Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
Run Keyword If ${teardown_device} Delete All Devices and Verify
- Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
+ Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix}
+ ... without_pm_data=False
Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout}
Close All ONOS SSH Connections
- Remove Tech Profile
+ Remove Tech Profile ${INFRA_NAMESPACE}
Setup Test
[Documentation] Pre-test Setup
@@ -318,12 +320,12 @@
Do Onu Etcd Data Check
[Documentation] Check Onu data stored in etcd
- Validate Onu Data In Etcd defaultkvstoreprefix=${kvstoreprefix}
+ Validate Onu Data In Etcd namespace=${INFRA_NAMESPACE} defaultkvstoreprefix=${kvstoreprefix}
Do Onu Flow Check
[Documentation] This keyword iterate all OLTs and performs Do Onu Flow Checks Per OLT
# Check and store vlan rules
- ${firstvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd
+ ${firstvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd ${INFRA_NAMESPACE}
... defaultkvstoreprefix=${kvstoreprefix}
FOR ${J} IN RANGE 0 ${num_olts}
${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
@@ -348,8 +350,8 @@
#check for previous state is kept (normally omci-flows-pushed)
Sleep 10s
Run Keyword And Continue On Failure Current State Test All Onus ${state2test}
- ${secondvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd nbofcookieslice=3
- ... prevvlanrules=${firstvlanrules} defaultkvstoreprefix=${kvstoreprefix}
+ ${secondvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd namespace=${INFRA_NAMESPACE}
+ ... nbofcookieslice=3 prevvlanrules=${firstvlanrules} defaultkvstoreprefix=${kvstoreprefix}
FOR ${J} IN RANGE 0 ${num_olts}
${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
@@ -361,12 +363,13 @@
Run Keyword If ${print2console} Log \r\nStart State Test All Onus. console=yes
Run Keyword And Continue On Failure Current State Test All Onus ${state2test}
Run Keyword If ${print2console} Log \r\nFinished State Test All Onus. console=yes
- Run Keyword And Continue On Failure Validate Vlan Rules In Etcd prevvlanrules=${firstvlanrules}
+ Run Keyword And Continue On Failure Validate Vlan Rules In Etcd namespace=${INFRA_NAMESPACE}
+ ... prevvlanrules=${firstvlanrules}
... setvidequal=True defaultkvstoreprefix=${kvstoreprefix}
Do Check Tech Profile
[Documentation] This keyword checks the loaded TechProfile
- ${namespace}= Set Variable default
+ [Arguments] ${namespace}=default
${podname}= Set Variable etcd
${commandget} Catenate
... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/XGS-PON/64'
@@ -385,7 +388,8 @@
${num_of_expected_matches}= Set Variable If "${techprofile}"!="default" or ${length}>0 1 0
Should Be Equal As Integers ${num_of_expected_matches} ${num_of_count_matches}
... TechProfile (${TechProfile}) not loaded correctly: found(${num_of_count_matches}) expected(${num_of_expected_matches})
- Validate Resource Instances Used Gem Ports ${num_gem_ports} defaultkvstoreprefix=${kvstoreprefix}
+ Validate Resource Instances Used Gem Ports ${num_gem_ports} namespace=${namespace}
+ ... defaultkvstoreprefix=${kvstoreprefix}
Do Disable Enable Onu Test
[Documentation] This keyword disables/enables all onus and checks the states.
@@ -409,6 +413,7 @@
Do Power Off Power On Onu Device
[Documentation] This keyword power off/on all onus and checks the states.
+ [Arguments] ${namespace}=voltha
Power Off ONU Device ${namespace}
Sleep 5s
${alternativeonustates}= Create List omci-flows-deleted
diff --git a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
index 3b86bbc..db6f8a4 100755
--- a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
@@ -36,7 +36,8 @@
Resource ../../variables/variables.robot
*** Variables ***
-${namespace} voltha
+${NAMESPACE} voltha
+${INFRA_NAMESPACE} default
${timeout} 60s
${of_id} 0
${logical_id} 0
@@ -90,7 +91,7 @@
Log ${LogInfo} console=yes
Common Test Suite Setup
# delete etcd MIB Template Data
- Delete MIB Template Data
+ Delete MIB Template Data ${INFRA_NAMESPACE}
Teardown Suite
[Documentation] Replaces the Suite Teardown in utils.robot.
@@ -102,7 +103,7 @@
Run Keyword If ${teardown_device} Delete All Devices and Verify
Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM
# delete etcd MIB Template Data (for repeating test)
- Delete MIB Template Data
+ Delete MIB Template Data ${INFRA_NAMESPACE}
Close All ONOS SSH Connections
Perform ONU MIB Template Data Test
@@ -115,18 +116,18 @@
# Start first Onu
${src}= Set Variable ${hosts.src[${0}]}
Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes
- ${bbsim_pod}= Get Pod Name By Label ${namespace} release bbsim0
- Power On ONU ${namespace} ${bbsim_pod} ${src['onu']}
+ ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0
+ Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']}
${timeStart}= Get Current Date
${firstonustartup}= Get ONU Startup Duration ${firstonu} ${timeStart}
# check MIB Template data stored in etcd
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s
- ... Verify MIB Template Data Available
+ ... Verify MIB Template Data Available ${INFRA_NAMESPACE}
# Start second Onu
${src}= Set Variable ${hosts.src[${1}]}
Log ONU ${src['onu']}: startup without MIB upload cycle by using of template data of etcd. console=yes
- ${bbsim_pod}= Get Pod Name By Label ${namespace} release bbsim0
- Power On ONU ${namespace} ${bbsim_pod} ${src['onu']}
+ ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0
+ Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']}
${timeStart}= Get Current Date
${secondonustartup}= Get ONU Startup Duration ${secondonu} ${timeStart}
# compare both durations, second onu should be at least 3 times faster