[CORD-2713] Update to Test Guide

Change-Id: I4a440ea44dbc5ef0238087ac61324a0971aa08a3
diff --git a/docs/README.md b/docs/README.md
index 3cbee86..a6ff9b1 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,27 +1,33 @@
 # Testing CORD
 
-CORD Tester is an automation framework used to test CORD. The
-framework currently includes extensions to test R-CORD, with
-extensions for other flavors of CORD in progress.
+CORD Tester is an automation framework that has been developed to test CORD. The
+framework currently includes extensions to test R-CORD. Few framework
+modules have been developed to test M-CORD and E-CORD basic tests.
+
+CORD Tester framework is typically deployed as one or more Docker containers, either on
+the CORD POD or adjacent to the POD and interacts with the POD through the interfaces.
+The Cord-Tester container is deployed as a docker container, residing on the headnode
+of the POD. It is brought up with double vlan tagged interfaces (s-tags and c-tags of
+subscriber's traffic) to conduct dataplane traffic testing. The following reference
+diagram gives a brief overview of how the test container interacts with the POD.
+
+![Cord Test Container](images/test_container.png)
 
 The framework is modular, making it easy to test all the components
 that make up CORD. It supports both end-to-end tests and
 functional tests of individual components.
+The suite of tests is constantly evolving with more features and tests.
 
-The suite of tests is constantly evolving, with the latest testing plan
-maintained on the
-[CORD wiki](https://wiki.opencord.org/display/CORD/System+Tests),
-including the latest list of
-[functional test](https://wiki.opencord.org/display/CORD/Functional)
-and
-[performance/scaling tests](https://wiki.opencord.org/pages/viewpage.action?pageId=3014702).
-Also see the [Jenkins dashboard](https://jenkins.opencord.org/) for
-results from recent runs.
+Few links below provide detailed information of System Test Guide, Test Plans
+and Test Results.
+
+* [System Test Guide](https://wiki.opencord.org/display/CORD/System+Test+Guide)
+* [System Test Plans](https://wiki.opencord.org/display/CORD/System+Test+Plans)
+* [System Test Results](https://wiki.opencord.org/display/CORD/System+Test+Results)
 
 Additional information about the CORD Tester framework can be found
-in GitHub:
+on the GitHub:
 
 * [Prerequisites](https://github.com/opencord/cord-tester/blob/master/src/test/setup/prerequisites.sh)
 
 * [Source Code](https://github.com/opencord/cord-tester)
-
diff --git a/docs/images/qa-jenkins.png b/docs/images/qa-jenkins.png
index a091a90..14e6eb0 100644
--- a/docs/images/qa-jenkins.png
+++ b/docs/images/qa-jenkins.png
Binary files differ
diff --git a/docs/images/qa-testbeds.png b/docs/images/qa-testbeds.png
new file mode 100644
index 0000000..c8db197
--- /dev/null
+++ b/docs/images/qa-testbeds.png
Binary files differ
diff --git a/docs/images/test_container.png b/docs/images/test_container.png
new file mode 100644
index 0000000..bb4c7e1
--- /dev/null
+++ b/docs/images/test_container.png
Binary files differ
diff --git a/docs/qa_testenv.md b/docs/qa_testenv.md
new file mode 100644
index 0000000..4d4bf6c
--- /dev/null
+++ b/docs/qa_testenv.md
@@ -0,0 +1,25 @@
+# CORD Test Environment
+
+Several jenkins based jobs are created to run tests on the following platforms
+* Physical POD
+* Virtual POD(Cord-in-a-Box)
+* VMs
+
+## Test Beds
+Following picture below describes various test environments that are used to setup CORD and a brief overview on the type of tests that are performed on that test bed.
+
+![Test Beds](images/qa-testbeds.png)
+
+## Jenkins Test Setup
+
+The following diagram shows how the test servers are interconnected
+
+![QA Jenkins Setup](images/qa-jenkins.png)
+
+* To view results from recent runs of the jenkins jobs, please view the [Jenkins dashboard](https://jenkins.opencord.org/)
+
+## Jenkins Integration with Physical POD
+
+The following diagram shows how Jenkins interconnects with a Physical POD.
+
+![QA Physical POD setup](images/qa-pod-setup.png)
diff --git a/docs/qa_testsetup.md b/docs/qa_testsetup.md
index 8b57aea..e45c6da 100644
--- a/docs/qa_testsetup.md
+++ b/docs/qa_testsetup.md
@@ -1,18 +1,65 @@
-# CORD Test Environment
+# Setting Up CORD Tester Environment
 
-Several jenkins based jobs are created to run tests on the following platforms
-* Cord-in-a-Box
-* Physical POD
-* VMs
+## Configure Automation Framework
 
-## Jenkins Test Setup
+* When the POD/Cord-in-a-Box is installed, cord-tester repo is downloaded on the head node at `/opt/cord/test` directory
+* Tests can be run directly from the headnode or from a different VM then it can be done using the following command
 
-The following diagram shows how the test servers are interconnected
+```bash
+$ git clone https://gerrit.opencord.org/cord-tester
+```
+* Before executing any tests, proper modules need to be installed which can be done using the following command
 
-![QA Jenkins Setup](images/qa-jenkins.png)
+```bash
+cd /opt/cord/test/cord-tester/src/test/setup
+sudo ./prerequisites.sh --cord
+```
 
-## Jenkins Integration with Physical POD
+## Executing Tests
 
-The following diagram shows how Jenkins interconnects with a Physical POD.
+ Most of the tests in cord-tester framework are written in `python` and `RobotFramework`.
+ Few examples for test execution are shown below
 
-![QA Physical POD setup](images/qa-pod-setup.png)
+ * Executing a sample test
+
+```bash
+cd /opt/cord/test/cord-tester/src/test/robot/
+pybot SanityPhyPOD.robot
+```
+
+### Executing Control Plane Tests
+* Each control plane test uses input data in `json` format which are present under `/opt/cord/test/cord-tester/src/test/cord-api/Tests/data`
+* Before running control plane tests, a properties file need to be edited as shown below.
+  Update the following attributes accordingly
+
+```bash
+cd  /opt/cord/test/cord-tester/src/test/cord-api/Properties
+$ cat RestApiProperties.py
+
+SERVER_IP = 'localhost'
+SERVER_PORT = '9101'
+USER = 'xosadmin@opencord.org'
+PASSWD = ''
+```
+
+* To run tests
+
+```bash
+$ cd /opt/cord/test/cord-tester/src/test/cord-api/
+$ pybot <testcase.txt>
+```
+## Executing Functional/Module Tests
+* There are several functional tests written to test various modules of CORD independently.
+* Before executing module based tests, following steps need to be performed which will create a `test container` and sets up the environment in the container to run tests.
+
+```bash
+cd /opt/cord/test/cord-tester/src/test/setup/
+sudo ./cord-test.py setup -m manifest-cord.json
+```
+
+* Run a single test from a module
+
+```bash
+sudo ./cord-test.py  run -t dhcp:dhcp_exchange.test_dhcp_1request
+```
+For more detailed explanations of the cord-tester options please check https://github.com/opencord/cord-tester/blob/master/docs/running.md
diff --git a/docs/validate_pods.md b/docs/validate_pods.md
new file mode 100644
index 0000000..48e642c
--- /dev/null
+++ b/docs/validate_pods.md
@@ -0,0 +1,150 @@
+# Validating PODs
+
+PODs are deployed everynight using Jenkins Build System.
+After a successful installation of the POD, test jobs are triggered which validate the
+following categories of tests
+
+* Post Installation Verification
+
+* Sanity Tests
+
+* Functional Tests (Control and Data Plane)
+
+* Soak Tests
+
+## Post Installation Tests
+
+These tests perform the following validations
+
+* Required Docker Containers are up and running
+* Synchronizer Logs are correct
+* Required ONOS applications are installed in ONOS Fabric and ONOS CORD
+* ONOS Logs does not contain any errors
+
+To execute the test, perform the following from the head node
+
+```bash
+cd /opt/cord/build
+make collect-diag
+cd /opt/cord/test/cord-tester/src/test/diag
+pybot verifyCollectDiag.robot
+```
+
+## Sanity Checks on the installed POD
+
+Following validations are performed after installation:
+
+* Headnode interfaces are up and has external connectivity
+* Compute nodes can ping each other through the fabric
+* Computes nodes can ping the switches
+* `cordvtn` app is running and identifies the nodes and the fabric devices
+* Required MAAS services are up and running
+* Status of Docker containers
+* Juju Service States
+* MAAS Cli commands
+* Openstack LXD Container States
+* Fabric Switch services
+* Ping all Fabric switches
+
+To execute the test, perform the following on the headnode
+
+```bash
+cd /opt/cord/test/cord-tester/src/test/robot
+pybot SanityPhyPOD.robot
+```
+## Functional Tests
+
+Control and Data plane tests can be executed on the POD once the
+sanity checks are successful.
+
+### Executing Control Plane Tests
+
+To validate the functionality of vSG instance creations and there by
+validating the end-end functionality checks on the related APIs, the
+following control plane test can be executed.
+
+* Edit the attributes shown below in the properties file
+
+```bash
+$ cd  /opt/cord/test/cord-tester/src/test/cord-api/Properties
+$ cat RestApiProperties.py
+
+SERVER_IP = 'localhost'
+SERVER_PORT = '9101'
+USER = 'xosadmin@opencord.org'
+PASSWD = ''
+```
+* To run the test
+
+```bash
+cd /opt/cord/test/cord-tester/src/test/cord-api/
+pybot Ch_MultiInstance.txt
+```
+
+### Data Plane Tests
+
+Once the vSG instances are created after execution of the above
+`control plane` test, `data plane` tests can be executed to verify
+if the data traffic passes through the created vSG/vcpe from the
+cord-test container which simulates the interface that was created
+with similar `s_tag and c_tag`
+
+Following steps are performed when the data plane test is executed.
+
+* vSG Instances in OpenStack Nova are created per subscriber created
+* vSG Instances are ACTIVE and are reachable via mgmt interface
+* Configures X-Connects for subscribers in onos-fabric for the overlay fabric
+* Configures a dhclient on the Cord-Tester containers interface that is being
+  used as the vSG Subscriber
+* Validates a DHCP IP address is received from the vCPE Container and external
+connectivity is reachable through the vCPE
+
+To run a data plane test, perform the following steps
+
+* Update the `olt_config.json` file in the `setup` directory to include
+  the `s_tag` and `c_tag` used in the Control-Plane Test with the
+  reserved flag turned on and create the `cord test container`
+
+```bash
+$ cd /opt/cord/test/cord-tester/src/test/setup
+$ cat out_config.json
+{ "olt" : false,
+  "uplink" : 2,
+  "vlan" : 0,
+  "port_map" : { "num_ports" : 11, "start_vlan" : 1000, "nr_switches": 1 },
+  "vcpe" :
+  [
+        {
+          "port" : "fabric", "type" : "reserved", "s_tag" : 415, "c_tag" : 222
+        },
+        {
+          "port" : "fabric", "type" : "reserved", "s_tag" : 333, "c_tag" : 888
+        },
+        {
+          "port" : "fabric", "type" : "reserved", "s_tag" : 555, "c_tag" : 999
+        },
+        {
+          "port" : "fabric", "type" : "reserved", "s_tag" : 666, "c_tag" : 661
+        }
+      ]
+}
+```
+
+```bash
+sudo ./cord-test.py setup -m manifest-onf-cord.json
+```
+
+* Validate the data plane connectivity
+
+```bash
+cd /opt/cord/test/cord-tester/src/test/vsg
+pybot vsg_dataplane_test.robot
+```
+
+>NOTE: All the control and data plane tests can also be executed on a `Virtual POD(Cord-in-a-Box)`
+>using the above procedure. Except for the data plane tests, where it needs to be run
+>using a different option as there are no crossconnects required to be provisioned on CiaB.
+
+```bash
+pybot -e xconnect vsg_dataplane_test.robot
+```