Fix automation 77/877/1
authorss412g <shuky.har-noy@intl.att.com>
Tue, 3 Sep 2019 15:34:28 +0000 (18:34 +0300)
committerss412g <shuky.har-noy@intl.att.com>
Tue, 3 Sep 2019 15:34:45 +0000 (18:34 +0300)
Change-Id: I63476a58bdd1efada2c1b42f71f9e32ca1338d40
Signed-off-by: ss412g <shuky.har-noy@intl.att.com>
31 files changed:
.gitignore
Automation/Tests/ConfigurationUpdate/ConfigurationUpdate_prepartations_tests.robot [new file with mode: 0644]
Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot
Automation/Tests/Get-All-Nodes-Real/Get_all_nodes_run_setup_and_get_all.robot
Automation/Tests/Get-All-Nodes/Get_nodes_Add_nodes_and_get.robot
Automation/Tests/Get-All-Nodes/getnodes.py [new file with mode: 0644]
Automation/Tests/Health/get_health_check.robot
Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot [new file with mode: 0644]
Automation/Tests/LoadInfomation/Loadinformation_verify_saving.robot [new file with mode: 0644]
Automation/Tests/LoadInfomation/__init__.robot [new file with mode: 0644]
Automation/Tests/LoadInfomation/config.py [new file with mode: 0644]
Automation/Tests/LoadInfomation/loadscripts.py [new file with mode: 0644]
Automation/Tests/RedButton/RedButton_CONNECTED.robot
Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot
Automation/Tests/RedButton/RedButton_CONNECTING.robot
Automation/Tests/RedButton/RedButton_CONNECTION_FAILURE.robot
Automation/Tests/RedButton/RedButton_DISCONNECTED.robot
Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot
Automation/Tests/Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot
Automation/Tests/Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot
Automation/Tests/Reset_RIC_TO_RAN/Reset_unhappy.robot
Automation/Tests/Resource/Keywords.robot
Automation/Tests/Resource/config.py [new file with mode: 0644]
Automation/Tests/Resource/configuration.yaml [new file with mode: 0644]
Automation/Tests/Resource/resource.robot
Automation/Tests/Resource/scripts.py [new file with mode: 0644]
Automation/Tests/Unhappy/Resource_not_found.robot
Automation/Tests/Unhappy/Response400.robot
Automation/Tests/Unhappy/Response500.robot
Automation/Tests/Unhappy/Setup_failure.robot
Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot

index 6b78c35..816688e 100644 (file)
 E2Manager/asn1codec/e2ap_engine/converter-example
 E2Manager/asn1codec/tests/
 E2Manager/cp.out
+/Automation/Tests/ConfigurationUpdate/__pycache__/verifylogs.cpython-36.pyc
+/Automation/Tests/Get-All-Nodes/__pycache__/getnodes.cpython-36.pyc
+/Automation/Tests/LoadInfomation/__pycache__/Loadinformation_adding_data_and_overwrite.robot
+/Automation/Tests/LoadInfomation/__pycache__/Loadinformation_verify_saving.robot
+/Automation/Tests/LoadInfomation/__pycache__/__init__.robot
+/Automation/Tests/LoadInfomation/__pycache__/config.py
+/Automation/Tests/LoadInfomation/__pycache__/loadscripts.py
+/Automation/Tests/Resource/__pycache__/config.cpython-36.pyc
+/Automation/Tests/Resource/__pycache__/scripts.cpython-36.pyc
diff --git a/Automation/Tests/ConfigurationUpdate/ConfigurationUpdate_prepartations_tests.robot b/Automation/Tests/ConfigurationUpdate/ConfigurationUpdate_prepartations_tests.robot
new file mode 100644 (file)
index 0000000..849052d
--- /dev/null
@@ -0,0 +1,58 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+
+*** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     REST      ${url}
+
+
+*** Variables ***
+${Run_Config}       docker exec gnbe2_simu pkill gnbe2_simu -INT
+${Save_e2_log}      docker logs --tail 300 gnbe2_simu > gnb.log
+${Save_e2mgr_log}   docker logs --tail 300 e2mgr > e2mgr.log
+
+*** Test Cases ***
+X2 - Setup and Get
+    Post Request setup node b x-2
+    Get Request node b enb test1
+
+
+Run Configuration update
+    Run    ${Run_Config}
+    Sleep   1s
+
+Remove log files
+    Remove File  ${EXECDIR}/gnb.log
+    Remove File  ${EXECDIR}/e2mgr.log
+
+Save logs
+    Sleep   1s
+    Run     ${Save_e2_log}
+    Run     ${Save_e2mgr_log}
+
+
+
+
+
+
+
+
index afe843d..ff7b4f5 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index b9078b4..0277458 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup  Prepare Enviorment
 Library      Process
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
@@ -28,6 +29,7 @@ Library     REST      ${url}
 Run x2 setup
     Post Request setup node b x-2
     Integer     response status       200
+    Sleep  2s
     GET      /v1/nodeb/test1
     Integer  response status  200
     String   response body ranName    test1
@@ -38,6 +40,7 @@ Run x2 setup
 Run endc setup
     Post Request setup node b endc-setup
     Integer     response status       200
+    Sleep  2s
     GET      /v1/nodeb/test2
     Integer  response status  200
     String   response body ranName    test2
@@ -47,7 +50,7 @@ Run endc setup
 
 Get all node ids
     GET     v1/nodeb/ids
-    #Output
+    Sleep  2s
     Integer  response status   200
     String   response body 0 inventoryName  test1
     String   response body 0 globalNbId plmnId   02f829
@@ -55,3 +58,11 @@ Get all node ids
     String   response body 1 inventoryName  test2
     String   response body 1 globalNbId plmnId   42f490
     String   response body 1 globalNbId nbId     000004
+
+
+
+
+
+
+
+
index adbc73d..0f77a7a 100755 (executable)
 ##############################################################################
 
 *** Settings ***
-Suite Setup  Flush Redis
+Suite Setup   Prepare Enviorment
 Library      Process
 Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
-Library     ${CURDIR}/scripts.py
+Library     ${CURDIR}/getnodes.py
 Library     REST      ${url}
 
 
@@ -29,7 +30,7 @@ Library     REST      ${url}
 
 *** Test Cases ***
 Add nodes to redis db
-    ${result}   scripts.add
+    ${result}   getnodes.add
     Should Be Equal As Strings  ${result}  True
 
 
@@ -45,7 +46,10 @@ Get all node ids
 
 
 
-*** Keywords ***
-Flush Redis
-    ${result}   scripts.flush
-    Should Be Equal As Strings  ${result}  True
+
+
+
+
+
+
+
diff --git a/Automation/Tests/Get-All-Nodes/getnodes.py b/Automation/Tests/Get-All-Nodes/getnodes.py
new file mode 100644 (file)
index 0000000..e358fed
--- /dev/null
@@ -0,0 +1,54 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+import config
+import redis
+
+
+def add():
+
+    c = config.redis_ip_address
+
+    p = config.redis_ip_port
+
+    r = redis.Redis(host=c, port=p, db=0)
+
+    r.flushall()
+
+    r.set("{e2Manager},ENB:02f829:007a80", "\n\x05test1\x12\t10.0.2.15\x18\xc9+ \x01*\x10\n\x0602f829\x12\x06007a800\x01:3\b\x01\x12/\bc\x12\x0f02f829:0007ab50\x1a\x040102\"\x0602f829*\n\n\b\b\x01\x10\x01\x18\x04 \x040\x01")
+
+    r.set("{e2Manager},RAN:test1","\x12\t10.0.2.15\x18\xc9+ \x03H\x01R\x02\b\t")
+
+    r.set("{e2Manager},PCI:test1:63" , "\b\x01\x12/\bc\x12\x0f02f829:0007ab50\x1a\x040102\"\x0602f829*\n\n\b\b\x01\x10\x01\x18\x04 \x040\x01")
+
+    r.set("{e2Manager},CELL:02f829:0007ab50" ,  "\b\x01\x12/\bc\x12\x0f02f829:0007ab50\x1a\x040102\"\x0602f829*\n\n\b\b\x01\x10\x01\x18\x04 \x040\x01")
+
+    r.sadd("{e2Manager},ENB" , "\n\x05test1\x12\x10\n\x0602f829\x12\x06007a80")
+
+
+    r.set("{e2Manager},GNB:03f829:002234", "\n\x05test2\x12\t10.0.2.16\x18\xc9+ \x01*\x10\n\x0702f829\x12\x070012340\x02BI\nG\nE\bc\x12\x1102f829:0008ab0120*\x0602f8290\x01:$\n\"\n\t\bd\"\x05\b\t\x12\x01\t\x12\t\bd\"\x05\b\t\x12\x01\t\x1a\x04\b\x01\x10\x01\"\x04\b\x01\x10\x01")
+
+    r.set("{e2Manager},RAN:test2", "\n\x05test2\x12\t10.0.2.15\x18\xc9+ \x01*\x10\n\x0702f829\x12\x070012340\x03BI\nG\nE\bc\x12\x1103f829:0008ab0120*\x0602f8290\x01:$\n\"\n\t\bd\"\x05\b\t\x12\x01\t\x12\t\bd\"\x05\b\t\x12\x01\t\x1a\x04\b\x01\x10\x01\"\x04\b\x01\x10\x01")
+
+    r.set("{e2Manager},PCI:test2:63", "\b\x02\x1aG\nE\bc\x12\x1102f829:0008ab0120*\x0702f8290\x01:$\n\"\n\t\bd\"\x05\b\t\x12\x01\t\x12\t\bd\"\x05\b\t\x12\x01\t\x1a\x04\b\x01\x10\x01\"\x04\b\x01\x10\x01")
+
+    r.set("{e2Manager},NRCELL:02f829:0007ab0120", "\b\x02\x1aG\nE\bc\x12\x1102f829:0007ab0120*\x0602f8290\x01:$\n\"\n\t\bd\"\x05\b\t\x12\x01\t\x12\t\bd\"\x05\b\t\x12\x01\t\x1a\x04\b\x01\x10\x01\"\x04\b\x01\x10\x01")
+
+    r.sadd("{e2Manager},GNB","\n\x05test2\x12\x10\n\x0603f829\x12\x06001234")
+
+    return True
index 6d05a8c..8cbacab 100755 (executable)
@@ -17,6 +17,8 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/Keywords.robot
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 Library     REST      ${url}
diff --git a/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot b/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot
new file mode 100644 (file)
index 0000000..3aab161
--- /dev/null
@@ -0,0 +1,53 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup  Prepare Simulator For Load Information
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     Collections
+Library     Process
+Library     ${CURDIR}/loadscripts.py
+Library     REST      ${url}
+
+
+
+*** Test Cases ***
+Verify Load information doesn't exist in redis
+    ${result}=     loadscripts.verify
+    Should Be Equal As Strings      ${result}   False
+
+Adding Load information to overwrite on
+   ${result}=   loadscripts.add
+   Should Be Equal As Strings  ${result}    True
+
+
+Trigger X-2 Setup for load information
+    Post Request setup node b x-2
+    Integer     response status       200
+    Sleep  1s
+    GET      /v1/nodeb/test1
+    Integer  response status  200
+    String   response body connectionStatus    CONNECTED
+
+
+Verify Load information does exist in redis
+   ${result}=   loadscripts.verify_value
+   Should Be Equal As Strings  ${result}    True
+
diff --git a/Automation/Tests/LoadInfomation/Loadinformation_verify_saving.robot b/Automation/Tests/LoadInfomation/Loadinformation_verify_saving.robot
new file mode 100644 (file)
index 0000000..0422dd1
--- /dev/null
@@ -0,0 +1,53 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup  Prepare Simulator For Load Information
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     Collections
+Library     Process
+Library     ${CURDIR}/loadscripts.py
+Library     REST      ${url}
+
+
+
+
+
+
+*** Test Cases ***
+Verify Load information doesn't exist in redis
+    ${result}=     loadscripts.verify
+    Should Be Equal As Strings      ${result}   False
+
+
+Trigger X-2 Setup for load information
+    Post Request setup node b x-2
+    Integer     response status       200
+    Sleep  1s
+    GET      /v1/nodeb/test1
+    Integer  response status  200
+    String   response body connectionStatus    CONNECTED
+
+
+Verify Load information does exist in redis
+    Sleep  2s
+    ${result}=     loadscripts.verify
+    Should Be Equal As Strings      ${result}   True
+
diff --git a/Automation/Tests/LoadInfomation/__init__.robot b/Automation/Tests/LoadInfomation/__init__.robot
new file mode 100644 (file)
index 0000000..427f239
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+*** Settings ***
+Documentation    ORAN Load Infomration scenarios
diff --git a/Automation/Tests/LoadInfomation/config.py b/Automation/Tests/LoadInfomation/config.py
new file mode 100644 (file)
index 0000000..b608bee
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+redis_ip_address = 'localhost'
+redis_ip_port = 6379
diff --git a/Automation/Tests/LoadInfomation/loadscripts.py b/Automation/Tests/LoadInfomation/loadscripts.py
new file mode 100644 (file)
index 0000000..8615384
--- /dev/null
@@ -0,0 +1,67 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+
+import redis
+import config
+
+
+def verify_value():
+
+    c = config.redis_ip_address
+
+    p = config.redis_ip_port
+
+    r = redis.Redis(host=c, port=p, db=0)
+
+    value = "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00"
+
+    if r.get("{e2Manager},LOAD:test1") != value:
+        return True
+    else:
+        return False
+
+
+def add():
+
+    c = config.redis_ip_address
+
+    p = config.redis_ip_port
+
+    r = redis.Redis(host=c, port=p, db=0)
+
+    r.set("{e2Manager},LOAD:test1", "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00")
+
+    if r.exists("{e2Manager},LOAD:test1"):
+        return True
+    else:
+        return False
+
+
+def verify():
+
+    c = config.redis_ip_address
+
+    p = config.redis_ip_port
+
+    r = redis.Redis(host=c, port=p, db=0)
+
+    if r.exists("{e2Manager},LOAD:test1"):
+        return True
+    else:
+        return False
index 9cf2f39..4887907 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 23221d7..d546377 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 7d317c1..bf38ec0 100755 (executable)
 #
 ##############################################################################
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
 Library    Collections
 Library     REST      ${url}
-
-*** Variables ***
-${stop_docker_e2}      docker stop e2
+Suite Teardown   Start E2
 
 
 
@@ -47,7 +46,7 @@ Prepare Ran in Connecting connectionStatus
 
 Disconnect Ran
    PUT    /v1/nodeb/shutdown
-   Integer   response status   204
+   Integer   response status   500
 
 
 Verfiy Shutdown ConnectionStatus
@@ -55,5 +54,5 @@ Verfiy Shutdown ConnectionStatus
     GET      /v1/nodeb/test1
     Integer  response status  200
     String   response body ranName    test1
-    String   response body connectionStatus    SHUT_DOWN
+    String   response body connectionStatus    SHUTTING_DOWN
 
index 581aa81..0516030 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 575fbad..b9a021f 100755 (executable)
@@ -16,6 +16,7 @@
 #
 ##############################################################################
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 187d56a..1bbe20f 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 13eeafd..e5de9ce 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 651b218..2a64b09 100755 (executable)
@@ -17,6 +17,7 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index 546a92d..587ded7 100755 (executable)
@@ -16,6 +16,7 @@
 #
 ##############################################################################
 *** Settings ***
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
index e5af3d3..20b4e3a 100755 (executable)
 
 *** Settings ***
 Documentation   Keywords file
+Library     ${CURDIR}/scripts.py
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 
 
-
-
-
 *** Keywords ***
 Post Request setup node b x-2
     Set Headers     ${header}
     POST        /v1/nodeb/x2-setup    ${json}
 
 
-
 Get Request node b enb test1
     Sleep    1s
     GET      /v1/nodeb/test1
@@ -41,8 +38,6 @@ Get Request node b enb test2
     Sleep    1s
     GET      /v1/nodeb/test2
 
-
-
 Post Request setup node b endc-setup
     Set Headers     ${header}
     POST        /v1/nodeb/endc-setup    ${endcjson}
@@ -51,8 +46,35 @@ Post Request setup node b endc-setup
 Prepare Simulator For Load Information
      Run And Return Rc And Output    ${stop_simu}
      Run And Return Rc And Output    ${docker_Remove}
-     Run And Return Rc And Output    ${run_simu}
+     ${flush}  scripts.flush
+     Should Be Equal As Strings  ${flush}  True
+     Run And Return Rc And Output    ${run_simu_load}
+     ${result}=  Run And Return Rc And Output     ${docker_command}
+     Should Be Equal As Integers    ${result[1]}    5
+
+Prepare Enviorment
+     ${flush}  scripts.flush
+     Should Be Equal As Strings  ${flush}  True
+     Run And Return Rc And Output    ${stop_simu}
+     Run And Return Rc And Output    ${docker_Remove}
+     Run And Return Rc And Output    ${run_simu_regular}
+     Run And Return Rc And Output    ${restart_e2adapter}
+     ${result}=  Run And Return Rc And Output     ${docker_command}
+     Should Be Equal As Integers    ${result[1]}    5
+
+Start E2
+     Run And Return Rc And Output    ${start_e2}
+     ${result}=  Run And Return Rc And Output     ${docker_command}
+     Should Be Equal As Integers    ${result[1]}    5
+     Sleep  2s
+
+Start Redis
+     Run And Return Rc And Output    ${redis_remove}
+     Run And Return Rc And Output    ${start_redis}
      ${result}=  Run And Return Rc And Output     ${docker_command}
      Should Be Equal As Integers    ${result[1]}    5
 
 
+
+
+
diff --git a/Automation/Tests/Resource/config.py b/Automation/Tests/Resource/config.py
new file mode 100644 (file)
index 0000000..b608bee
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+redis_ip_address = 'localhost'
+redis_ip_port = 6379
diff --git a/Automation/Tests/Resource/configuration.yaml b/Automation/Tests/Resource/configuration.yaml
new file mode 100644 (file)
index 0000000..676daf3
--- /dev/null
@@ -0,0 +1,10 @@
+logging:
+  logLevel: info
+http:
+  port: 3800
+rmr:
+  port: 3801
+  maxMsgSize: 4096
+notificationResponseBuffer: 100
+bigRedButtonTimeoutSec: 5
+maxConnectionAttempts: 300
index 2110d8d..9382db5 100755 (executable)
@@ -27,6 +27,18 @@ ${endcjson}    {"ranIp": "10.0.2.15","ranPort": 49999,"ranName":"test2"}
 ${resetcausejson}   {"cause": "misc:not-enough-user-plane-processing-resources"}
 ${header}  {"Content-Type": "application/json"}
 ${docker_command}  docker ps | grep 1.0 | wc --lines
-${run_simu}   docker run -d --name gnbe2_simu --env gNBipv4=localhost  --env gNBport=36422  --env duration=600000000000 --env indicationReportRate=1000000000 --env indicationInsertRate=0 -p 5577:36422/sctp snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_sim:1.0.5
+${run_simu_load}   docker run -d --name gnbe2_simu --env gNBipv4=localhost  --env gNBport=36422  --env duration=600000000000 --env indicationReportRate=1000000000 --env indicationInsertRate=0 -p 5577:36422/sctp snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_sim:1.0.5
 ${stop_simu}  docker stop gnbe2_simu
+${run_simu_regular}  docker run -d --name gnbe2_simu --env gNBipv4=localhost  --env gNBport=36422 --env duration=600000000000 --env indicationReportRate=0 --env indicationInsertRate=0 -p 5577:36422/sctp snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_sim:1.0.5
 ${docker_Remove}    docker rm gnbe2_simu
+${docker_cp}        docker cp ../Resource/configuration.yaml e2mgr:/opt/E2Manager/resources/configuration.yaml
+${docker_restart}   docker restart e2mgr
+${restart_simu}  docker restart gnbe2_simu
+${restart_e2adapter}  docker restart e2adapter
+${start_e2}  docker start e2
+${stop_docker_e2}      docker stop e2
+${start_redis}   docker run -d --name redis -p 6379:6379 --env DBAAS_SERVICE_HOST=10.0.2.15  snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/dbass:1.0.0
+${redis_remove}    docker rm redis
+
+
+
diff --git a/Automation/Tests/Resource/scripts.py b/Automation/Tests/Resource/scripts.py
new file mode 100644 (file)
index 0000000..49ebca5
--- /dev/null
@@ -0,0 +1,33 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+import config
+import redis
+
+
+def flush():
+
+    c = config.redis_ip_address
+
+    p = config.redis_ip_port
+
+    r = redis.Redis(host=c, port=p, db=0)
+
+    r.flushall()
+
+    return True
+
index a026317..50fbf3f 100755 (executable)
@@ -17,6 +17,8 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/Keywords.robot
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 Library     REST      ${url}
index 088792d..e4262e4 100755 (executable)
@@ -17,6 +17,8 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/Keywords.robot
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 Library     REST      ${url}
index 2ae4897..1e99b83 100755 (executable)
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/Keywords.robot
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 Library     REST      ${url}
+Suite Teardown   Start Redis
 
 *** Test Cases ***
 Get Request node b gnb - DB down - 500
@@ -27,9 +30,3 @@ Get Request node b gnb - DB down - 500
     GET      /v1/nodeb/test5
     Integer  response status   500
 
-
-*** Keywords ***
-Start dockers
-     Run And Return Rc And Output    ${run_script}
-     ${result}=  Run And Return Rc And Output     ${docker_command}
-     Should Be Equal As Integers    ${result[1]}    5
\ No newline at end of file
index 8e5d7c4..a53abd1 100755 (executable)
@@ -17,6 +17,8 @@
 ##############################################################################
 
 *** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/Keywords.robot
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
 Library     REST        ${url}
index cec8e84..08ed01b 100755 (executable)
@@ -17,7 +17,7 @@
 ##############################################################################
 
 *** Settings ***
-
+Suite Setup   Prepare Enviorment
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem