Test: Changes to cord-tester to make it work with latest ONOS relocating apps to opencord.
For _now_, keep prebuilt versions of cord apps since remote installation for opencord doesn't seem to work.
Also make the ciena cordigmp app compatible with latest ONOS.
Change test cases as well.

Change-Id: Ic8792eb4ee36afc4fc153bde993d0ef9f1d9a040
diff --git a/src/test/utils/OnosCtrl.py b/src/test/utils/OnosCtrl.py
index 880e8f6..92437cb 100644
--- a/src/test/utils/OnosCtrl.py
+++ b/src/test/utils/OnosCtrl.py
@@ -1,12 +1,12 @@
-# 
+#
 # Copyright 2016-present Ciena Corporation
 #
 # 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.
@@ -22,6 +22,7 @@
     auth = ('karaf', 'karaf')
     controller = os.getenv('ONOS_CONTROLLER_IP') or 'localhost'
     cfg_url = 'http://%s:8181/onos/v1/network/configuration/' %(controller)
+    maven_repo = 'http://central.maven.org/maven2/org/onosproject'
     applications_url = 'http://%s:8181/onos/v1/applications' %(controller)
 
     def __init__(self, app, controller = None):
@@ -97,6 +98,19 @@
         return result.ok, result.status_code
 
     @classmethod
+    def install_app_from_url(cls, app_name, app_version, app_url = None, onos_ip = None):
+        params = {'activate':'true'}
+        headers = {'content-type':'application/json'}
+        if app_url is None:
+            app_oar_file = '{}-{}.oar'.format(app_name, app_version)
+            app_url = '{0}/{1}/{2}/{3}'.format(cls.maven_repo, app_name, app_version, app_oar_file)
+        params['url'] = app_url
+        url = cls.applications_url if onos_ip is None else 'http://{0}:8181/onos/v1/applications'.format(onos_ip)
+        result = requests.post(url, auth = cls.auth,
+                               json = params, headers = headers)
+        return result.ok, result.status_code
+
+    @classmethod
     def uninstall_app(cls, app_name, onos_ip = None):
         params = {'activate':'true'}
         headers = {'content-type':'application/octet-stream'}