RIFT OSM R1 Initial Submission
[osm/SO.git] / rwlaunchpad / ra / pytest / ns / pingpong / test_pingpong_longevity.py
diff --git a/rwlaunchpad/ra/pytest/ns/pingpong/test_pingpong_longevity.py b/rwlaunchpad/ra/pytest/ns/pingpong/test_pingpong_longevity.py
new file mode 100644 (file)
index 0000000..ff8fa96
--- /dev/null
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# 
+#   Copyright 2016 RIFT.IO Inc
+#
+#   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.
+#
+# Author(s): Paul Laidler
+# Creation Date: 2016/01/04
+#
+
+import pytest
+import rift.vcs.vcs
+import time
+
+import gi
+
+@pytest.fixture(scope='module')
+def rwnsr_proxy(mgmt_session):
+    return mgmt_session.proxy(RwNsrYang)
+
+def test_launchpad_longevity(mgmt_session, mgmt_domain_name, rwnsr_proxy):
+    time.sleep(60)
+    rift.vcs.vcs.wait_until_system_started(mgmt_session)
+
+    nsr_opdata = rwnsr_proxy.get('/ns-instance-opdata')
+    for nsr in nsr_opdata.nsr:
+        xpath = ("/ns-instance-opdata"
+                 "/nsr[ns-instance-config-ref='%s']"
+                 "/operational-status") % (nsr.ns_instance_config_ref)
+        operational_status = rwnsr_proxy.get(xpath)
+        assert operational_status == 'running'
+