Fixes and enhancements to ATT workflow test

Change-Id: I11d08b4ec26336419ce966016cbeefc59a680226
diff --git a/VERSION b/VERSION
index 57181b5..70e310c 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-2.0.3
+2.0.4
 
diff --git a/src/test/cord-api/Framework/DHCP.robot b/src/test/cord-api/Framework/DHCP.robot
index fbf62b5..67525e6 100644
--- a/src/test/cord-api/Framework/DHCP.robot
+++ b/src/test/cord-api/Framework/DHCP.robot
@@ -16,6 +16,7 @@
 Documentation     Library to DHCP Requests from an RG (source host)
 Library           OperatingSystem
 Library           SSHLibrary
+Resource          utils/utils.robot
 
 *** Keywords ***
 Send Dhclient Request
@@ -41,3 +42,9 @@
     ${result}=    Read Until    ${prompt}
     SSHLibrary.Close Connection
     [Return]    ${result}
+
+IPv4 Address Assigned to DHCP Client
+    [Arguments]    ${ip}    ${user}    ${pass}    ${iface}
+    [Documentation]    Check if the sepcified interface has an IPv4 address assigned
+    ${output}=    Run Command On Remote System    ${ip}    ifconfig ${iface}    ${user}    ${pass}
+    Should Match Regexp    ${output}    \\b([0-9]{1,3}\\.){3}[0-9]{1,3}\\b
diff --git a/src/test/cord-api/Framework/Subscriber.robot b/src/test/cord-api/Framework/Subscriber.robot
index e4791f0..c925675 100644
--- a/src/test/cord-api/Framework/Subscriber.robot
+++ b/src/test/cord-api/Framework/Subscriber.robot
@@ -17,6 +17,7 @@
 Library           OperatingSystem
 Library           SSHLibrary
 Library           restApi.py
+Resource          ../../Framework/utils/utils.robot
 
 *** Keywords ***
 Send EAPOL Message
@@ -24,14 +25,12 @@
     [Documentation]    SSH's into the RG (src) and executes a particular auth request via wpa_supplicant client. Requested packet should exist on src.
     ${conn_id}=    SSHLibrary.Open Connection    ${ip}    prompt=${prompt}    timeout=${prompt_timeout}
     SSHLibrary.Login    ${user}    ${pass}
-    SSHLibrary.Write    sudo wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file}
+    SSHLibrary.Write    rm -f wpa.log
+    SSHLibrary.Write    sudo wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file} -f wpa.log
     Read Until    [sudo] password for ${user}:
     SSHLibrary.Write    ${pass}
-    ${result}=    Read Until    wpa_supplicant
-    Log To Console    \n\n ${result}\n
+    Wait Until Keyword Succeeds    30s    2s    Remote File Should Contain    ${conn_id}    wpa.log    authentication completed successfully
     SSHLibrary.Close Connection
-    Should Contain    ${result}    Successfully initialized wpa_supplicant
-    [Return]    ${result}
 
 Delete IP Addresses from Interface on Remote Host
     [Arguments]    ${ip}    ${user}    ${pass}    ${interface}    ${prompt}=$    ${prompt_timeout}=60s
@@ -137,4 +136,4 @@
     Read Until    [sudo] password for ${user}:
     SSHLibrary.Write    ${pass}
     ${result}=    Read Until    ${prompt}
-    SSHLibrary.Close Connection
\ No newline at end of file
+    SSHLibrary.Close Connection
diff --git a/src/test/cord-api/Framework/utils/utils.robot b/src/test/cord-api/Framework/utils/utils.robot
index 0bfcd13..c9e3c79 100644
--- a/src/test/cord-api/Framework/utils/utils.robot
+++ b/src/test/cord-api/Framework/utils/utils.robot
@@ -26,7 +26,6 @@
 Run Command On Remote System
     [Arguments]    ${ip}    ${cmd}    ${user}    ${pass}    ${prompt}=$    ${prompt_timeout}=60s
     [Documentation]    SSH's into a remote host, executes command, and logs+returns output
-    BuiltIn.Log    Attempting to execute command "${cmd}" on remote system "${system}"
     ${conn_id}=    SSHLibrary.Open Connection    ${ip}    prompt=${prompt}    timeout=${prompt_timeout}
     SSHLibrary.Login    ${user}    ${pass}
     ${output}=    SSHLibrary.Execute Command    ${cmd}
@@ -204,3 +203,10 @@
     [Arguments]    ${ip}    ${user}    ${pass}    ${process}
     ${rc}=    Run Sudo Command On Remote System    ${ip}    sudo kill $(ps aux | grep '${process}' | awk '{print $2}'); echo $?    ${user}    ${pass}
     Should Contain    ${rc}    0
+
+Remote File Should Contain
+    [Arguments]    ${conn_id}    ${file_name}    ${pattern}
+    SSHLibrary.Switch Connection    ${conn_id}
+    SSHLibrary.Get File    ${file_name}    /tmp/
+    ${content}=    OperatingSystem.Get File    /tmp/${file_name}
+    Should Contain    ${content}    ${pattern}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
index 28bcb92..154b03c 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
@@ -65,9 +65,9 @@
     Wait Until Keyword Succeeds    60s    2s    Validate Subscriber Status    enabled
     Add Double Vlan Interface on Host    ${dst_ip}    ${dst_user}    ${dst_pass}    ${dst_dp_iface}    ${s_tag}    ${c_tag}
     Add IP Address on Interface on Host    ${dst_ip}    ${dst_user}    ${dst_pass}    ${dst_dp_ip}/24    ${dst_dp_iface}.${stag}.${c_tag}
-    Add Route to Remote Host    ${dst_ip}    ${dst_user}    ${dst_pass}    ${dst_dp_ip}    ${src_gateway}    ${dst_dp_iface}.${stag}.${c_tag}
     Start DHCP Server on Remote Host    ${dst_ip}    ${dst_user}    ${dst_pass}    ${dst_dp_iface}.${stag}.${ctag}
     Send Dhclient Request    ${src_ip}    ${src_user}    ${src_pass}    ${src_iface}
+    Wait Until Keyword Succeeds    60s    5s    IPv4 Address Assigned to DHCP Client    ${src_ip}    ${src_user}    ${src_pass}    ${src_iface}
     Wait Until Keyword Succeeds    60s    5s    Test Ping    PASS    ${src_ip}    ${src_user}    ${src_pass}    ${dst_dp_ip}    ${src_iface}
 
 *** Keywords ***
diff --git a/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json
index a27e9bc..dcfd3a5 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json
+++ b/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber.json
@@ -6,8 +6,9 @@
             "c_tag": 999,
             "onu_device": "ALPHe3d1cfa7",
             "nas_port_id": "PON 1/1/03/1:1.1.1",
-            "circuit_id": "foo",
-            "status": "pre-provisioned"
+            "circuit_id": "foo1",
+            "status": "pre-provisioned",
+            "remote_id": "bar1"
      }
   ]
 }
diff --git a/src/test/cord-api/Tests/data/RealOLTDevice.json b/src/test/cord-api/Tests/data/RealOLTDevice.json
index 0ac640d..1b93373 100644
--- a/src/test/cord-api/Tests/data/RealOLTDevice.json
+++ b/src/test/cord-api/Tests/data/RealOLTDevice.json
@@ -8,8 +8,9 @@
             "switch_port": "7",
             "outer_tpid": "0x8100",
             "name": "olt-1",
-            "uplink": "128",
-            "volt_service_id": 2
+            "uplink": "65536",
+            "volt_service_id": 2,
+            "nas_id": "NAS_ID"
     }
   ]
 }