fix etcd data check - part II
Change-Id: I949ef1f6d11def86c54ae3487a336f0531c0858d
diff --git a/libraries/onu_utilities.robot b/libraries/onu_utilities.robot
index aee249f..2db750c 100755
--- a/libraries/onu_utilities.robot
+++ b/libraries/onu_utilities.robot
@@ -218,8 +218,9 @@
... Furthermore it evaluates the values of onu_id and uni_id with values read from tp_path.
... Number of etcd entries has to match with the passed number.
[Arguments] ${nbofetcddata}=${num_all_onus} ${defaultkvstoreprefix}=voltha_voltha
+ ... ${without_prefix}=True ${without_pm_data}=True
${kvstoreprefix}= Get Kv Store Prefix ${defaultkvstoreprefix}
- ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix}
+ ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix} ${without_prefix} ${without_pm_data}
#prepare result for json convert
${result}= Prepare ONU Go Adapter ETCD Data For Json ${etcddata}
${jsondata}= To Json ${result}
@@ -255,9 +256,9 @@
... In case of a passed dictionary containing set_vids these will be checked for to
... current set-vid depending on setvidequal (True=equal, False=not equal).
[Arguments] ${nbofcookieslice}=1 ${reqmatchvid}=4096 ${prevvlanrules}=${NONE} ${setvidequal}=False
- ... ${defaultkvstoreprefix}=voltha_voltha
+ ... ${defaultkvstoreprefix}=voltha_voltha ${without_prefix}=True ${without_pm_data}=True
${kvstoreprefix}= Get Kv Store Prefix ${defaultkvstoreprefix}
- ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix}
+ ${etcddata}= Get ONU Go Adapter ETCD Data ${kvstoreprefix} ${without_prefix} ${without_pm_data}
#prepare result for json convert
${result}= Prepare ONU Go Adapter ETCD Data For Json ${etcddata}
${jsondata}= To Json ${result}
@@ -302,7 +303,9 @@
... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/${kvstoreprefix}/openonu'
${commandget}= Run Keyword If ${without_prefix} Catenate ${commandget}
... | grep -v service/${kvstoreprefix}/openonu
+ ... ELSE Set Variable ${commandget}
${commandget}= Run Keyword If ${without_pm_data} Catenate ${commandget} | grep -v instances_active
+ ... ELSE Set Variable ${commandget}
${result}= Exec Pod In Kube ${namespace} ${podname} ${commandget}
log ${result}
[Return] ${result}
diff --git a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
index c63d46e..00860fc 100755
--- a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
@@ -180,7 +180,7 @@
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 ${namespace} open-onu
- Validate Onu Data In Etcd 0
+ Validate Onu Data In Etcd 0 without_pm_data=False
Wait for Ports in ONOS for all OLTs ${onos_ssh_connection} 0 BBSM ${timeout}
Close All ONOS SSH Connections
@@ -221,7 +221,7 @@
# delete etcd MIB Template Data
Delete MIB Template Data
# check etcd data are empty
- Validate Onu Data In Etcd 0
+ Validate Onu Data In Etcd 0 without_pm_data=False
Sleep 5s
Do Reconcile In Determined State
diff --git a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
index e78b516..755a0f9 100755
--- a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
@@ -223,7 +223,7 @@
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
- Validate Onu Data In Etcd 0 ${kvstoreprefix}
+ Validate Onu Data In Etcd 0 ${kvstoreprefix} without_pm_data=False
Wait for Ports in ONOS for all OLTs ${onos_ssh_connection} 0 BBSM ${timeout}
Close All ONOS SSH Connections
Remove Tech Profile