[VOL-2282]
Run robot tests with Python 3
- Remove HTTP and database robot libraries that aren't used
- Make robot lint treat warnings as errors
- Reformat robot tests to pass lint, and other minor fixes
- Lint/reformat of python code
- Add yaml and json linting
- Clean up Makefile
- Assume the KUBECONFIG and VOLTCONFIG env vars are defined
Change-Id: Ibf0a6b525802ed907efc38b34c8e3b99b2044bf1
diff --git a/tests/functional/K8S_SystemTest.robot b/tests/functional/K8S_SystemTest.robot
index dcf47c5..ce0de14 100644
--- a/tests/functional/K8S_SystemTest.robot
+++ b/tests/functional/K8S_SystemTest.robot
@@ -19,11 +19,11 @@
*** Variables ***
${timeout} 120s
-${desired_ETCD_cluster_size} 3
-${minimal_ETCD_cluster_size} 2
-${namespace} voltha
-${ETCD_resources} etcdclusters.etcd.database.coreos.com
-${ETCD_name} voltha-etcd-cluster
+${desired_ETCD_cluster_size} 3
+${minimal_ETCD_cluster_size} 2
+${namespace} voltha
+${ETCD_resources} etcdclusters.etcd.database.coreos.com
+${ETCD_name} voltha-etcd-cluster
${ETCD_pod_label_key} etcd_cluster
${common_pod_label_key} app
${rwcore_pod_label_value} rw-core
@@ -34,38 +34,41 @@
Scale Down ETCD Cluster
[Documentation] Scale Down the ETCD cluster to minimal size, skip test if current cluster size < 3
[Tags] scaledown ETCDdown
- ${current_size}= Get ETCD Running Size voltha
+ ${current_size}= Get ETCD Running Size voltha
Pass Execution If '${current_size}' != '${desired_ETCD_cluster_size}'
... 'Skip the test if the cluster size smaller than minimal size 3'
# The minimal cluster size after scale down
# based on https://github.com/ETCD-io/ETCD/blob/master/Documentation/faq.md#what-is-failure-tolerance
Scale ETCD ${namespace} ${minimal_ETCD_cluster_size}
- Wait Until Keyword Succeeds ${timeout} 2s Validate ETCD Size ${namespace} ${minimal_ETCD_cluster_size}
Wait Until Keyword Succeeds ${timeout} 2s
- ... Check Expected Running Pods Number By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name} 2
+ ... Validate ETCD Size ${namespace} ${minimal_ETCD_cluster_size}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Check Expected Running Pods Number By Label ${namespace}
+ ... ${ETCD_pod_label_key} ${ETCD_name} 2
Scale Up ETCD Cluster
[Documentation] Recover the ETCD cluster by scaling up its size
[Tags] scaleup ETCDup
- ${current_size}= Get ETCD Running Size voltha
+ ${current_size}= Get ETCD Running Size voltha
Pass Execution If '${current_size}' != '${minimal_ETCD_cluster_size}'
... 'Skip the test if the cluster size smaller than minimal size 3'
Scale ETCD ${namespace} ${desired_ETCD_cluster_size}
# We scale up the size to 3, the recommended size of ETCD cluster.
- Wait Until Keyword Succeeds ${timeout} 2s Validate ETCD Size ${namespace} ${desired_ETCD_cluster_size}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Validate ETCD Size ${namespace} ${desired_ETCD_cluster_size}
ETCD Failure Test
[Documentation] Failure Scenario Test: ETCD Crash
[Tags] FailureTest
Delete K8s Pods By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Exist By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${rwcore_pod_label_value}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${ofagent_pod_label_value}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${adapter_openolt_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Do Not Exist By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${rwcore_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${ofagent_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${adapter_openolt_pod_label_value}
*** Keywords ***
Get ETCD Running Size