[VOL-2536] - Refactor the way we test the etcd cluster size changed.

- Put all test cases together due to the help of keyword `Perform Sanity
  Test`
- Remove unnecessary target in Makefile
- This test only works for full mode, should change the default port
  number of ONOS

Change-Id: I14064c90cd8fb600ab04238e084448e347283fbc
diff --git a/Makefile b/Makefile
index a7d53cf..f57c381 100644
--- a/Makefile
+++ b/Makefile
@@ -42,10 +42,6 @@
 ROBOT_DEBUG_LOG_OPT             ?=
 ROBOT_MISC_ARGS                 ?=
 
-ROBOT_SYSTEM_SETUP_MISC_ARGS    ?= -i scaledown -l systemup_log.html -r systemup_report.html -o systemup_output.xml
-ROBOT_SYSTEM_TEARDOWN_MISC_ARGS ?= -i scaleup -l systemdown_log.html -r systemdown_report.html -o sysstemdown_output.xml
-ROBOT_SYSTEM_FILE               ?= K8S_SystemTest.robot
-
 # for backwards compatibility
 sanity-kind: sanity-single-kind
 
@@ -87,10 +83,11 @@
 bbsim-scale-kind: ROBOT_FILE := Voltha_ScaleFunctionalTests.robot
 bbsim-scale-kind: voltha-test
 
-system-scale-test: ROBOT_FILE := Voltha_PODTests.robot
-system-scale-test: ROBOT_MISC_ARGS += -X -i sanity $(ROBOT_DEBUG_LOG_OPT)
-system-scale-test: ROBOT_CONFIG_FILE := $(ROBOT_SANITY_SINGLE_PON_FILE)
-system-scale-test: k8s-system-test
+#Only supported in full mode
+system-scale-test: ROBOT_FILE := K8S_SystemTest.robot
+system-scale-test: ROBOT_MISC_ARGS += -X -i functional $(ROBOT_DEBUG_LOG_OPT) -v ONOS_REST_PORT:8281 -v ONOS_SSH_PORT:8201
+system-scale-test: ROBOT_CONFIG_FILE := $(ROBOT_SANITY_MULT_PON_FILE)
+system-scale-test: voltha-test
 
 failure-test: ROBOT_MISC_ARGS += -X -i FailureTest $(ROBOT_DEBUG_LOG_OPT)
 failure-test: ROBOT_FILE := $(ROBOT_SYSTEM_FILE)
@@ -98,15 +95,6 @@
 failure-test: voltha-test
 
 voltha-test: ROBOT_MISC_ARGS += -e notready
-k8s-system-test: ROBOT_MISC_ARGS += -e notready
-
-#bbsim-only
-k8s-system-test: vst_venv
-	source ./$</bin/activate ; set -u ;\
-	cd tests/functional ;\
-	robot $(ROBOT_SYSTEM_SETUP_MISC_ARGS) $(ROBOT_MISC_ARGS) $(ROBOT_SYSTEM_FILE) && \
-	robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE) && \
-	robot $(ROBOT_SYSTEM_TEARDOWN_MISC_ARGS) $(ROBOT_MISC_ARGS) $(ROBOT_SYSTEM_FILE)
 
 voltha-test: vst_venv
 	source ./$</bin/activate ; set -u ;\
diff --git a/tests/functional/K8S_SystemTest.robot b/tests/functional/K8S_SystemTest.robot
index ce0de14..7810ef8 100644
--- a/tests/functional/K8S_SystemTest.robot
+++ b/tests/functional/K8S_SystemTest.robot
@@ -14,8 +14,16 @@
 
 *** Settings ***
 Documentation     Provide the function to perform system related test
-Library           OperatingSystem
+Suite Setup       Common Test Suite Setup
+Test Setup        Setup
+Test Teardown     Teardown
+Suite Teardown    Teardown Suite
+Resource          ../../libraries/onos.robot
+Resource          ../../libraries/voltctl.robot
+Resource          ../../libraries/voltha.robot
+Resource          ../../libraries/utils.robot
 Resource          ../../libraries/k8s.robot
+Resource          ../../variables/variables.robot
 
 *** Variables ***
 ${timeout}        120s
@@ -31,9 +39,9 @@
 ${adapter_openolt_pod_label_value}    adapter-open-olt
 
 *** Test Cases ***
-Scale Down ETCD Cluster
-    [Documentation]    Scale Down the ETCD cluster to minimal size, skip test if current cluster size < 3
-    [Tags]    scaledown    ETCDdown
+ECTD Scale Test
+    [Documentation]    Perform the sanity test if some ETCD endpoints crash
+    [Tags]    functional    bbsim
     ${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'
@@ -45,15 +53,10 @@
     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
-    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}
+    # Perform the sanity-test
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
     # We scale up the size to 3, the recommended size of ETCD cluster.
+    Scale ETCD    ${namespace}    ${desired_ETCD_cluster_size}
     Wait Until Keyword Succeeds    ${timeout}    2s
     ...    Validate ETCD Size    ${namespace}    ${desired_ETCD_cluster_size}