Merge "Make option for test functionality added to tool to upgrade vnf,ns descriptors...
authormarchettim <mmarchetti@sandvine.com>
Wed, 21 Feb 2018 15:35:28 +0000 (16:35 +0100)
committerGerrit Code Review <root@osm.etsi.org>
Wed, 21 Feb 2018 15:35:28 +0000 (16:35 +0100)
42 files changed:
descriptor-packages/mk/dirs.mk
descriptor-packages/mk/pkg.mk
descriptor-packages/nsd/VyOS_ns/src/VyOS_nsd.yaml
descriptor-packages/nsd/cirros_2vnf_ns/src/cirros_2vnf_nsd.yaml
descriptor-packages/nsd/cirros_noportsecurity_2vnf_ns/src/cirros_noportsecurity_2vnf_nsd.yaml
descriptor-packages/nsd/cirros_ns/src/cirros_nsd.yaml
descriptor-packages/nsd/cirros_set_vim_network_ns/src/cirros_set_vim_network_nsd.yaml
descriptor-packages/nsd/dns_aws_ns/src/dns_aws_nsd.yaml
descriptor-packages/nsd/ims_allin1_corpa/src/IMS-corpA__nsd.yaml
descriptor-packages/nsd/ping_pong_ns/src/ping_pong_nsd.yaml
descriptor-packages/nsd/ref1_ns/src/ref1_nsd.yaml
descriptor-packages/nsd/ref2_ns/src/ref2_nsd.yaml
descriptor-packages/nsd/ubuntu_cirros_multidisk_ns/src/ubuntu_cirros_multidisk_nsd.yaml
descriptor-packages/nsd/ubuntu_cloudinit_ns/src/ubuntu_cloudinit_nsd.yaml
descriptor-packages/nsd/ubuntu_epa_virtio_ns/src/ubuntu_epa_virtio_nsd.yaml
descriptor-packages/tools/upgrade_descriptor_version.py
descriptor-packages/vnfd/VyOS_vnf/src/VyOS__vnfd.yaml
descriptor-packages/vnfd/cirros_noportsecurity_vnf/src/cirros_noportsecurity_vnfd.yaml
descriptor-packages/vnfd/cirros_vnf/src/cirros_vnfd.yaml
descriptor-packages/vnfd/dns_aws_vnfd/src/dns_aws_vnfd.yaml
descriptor-packages/vnfd/ims_allin1_2p_vnf/src/IMS-ALLIN1__vnfd.yaml
descriptor-packages/vnfd/ping_vnf/src/ping_vnfd.yaml
descriptor-packages/vnfd/pong_vnf/src/pong_vnfd.yaml
descriptor-packages/vnfd/ref11_vnf/src/ref11_vnfd.yaml
descriptor-packages/vnfd/ref12_vnf/src/ref12_vnfd.yaml
descriptor-packages/vnfd/ref21_vnf/src/ref21_vnfd.yaml
descriptor-packages/vnfd/ref22_vnf/src/ref22_vnfd.yaml
descriptor-packages/vnfd/ubuntu_1iface_cloudinit_new_vnf/src/ubuntu_1iface_cloudinit_newfile_vnfd.yaml
descriptor-packages/vnfd/ubuntu_cirros_multidisk_vnf/src/ubuntu_cirros_multidisk_vnfd.yaml
descriptor-packages/vnfd/ubuntu_epa_virtio_vnf/src/ubuntu_epa_virtio_vnfd.yaml
descriptor-packages/vnfd/ubuntu_xenial_vnf/src/ubuntu_xenial_vnfd.yaml
installers/install_osm.sh
installers/shim_install_osm.sh [new file with mode: 0755]
jenkins/RO/install
jenkins/SO/install
jenkins/VCA/update-lxd-image.sh
jenkins/ci-pipelines/ci_stage_3.groovy
juju-charms/layers/pingpong/reactive/pingpong.py
systest/testcases/vim/test_vim.py
tools/gen-lxdimages.sh [new file with mode: 0755]
tools/gen-repo.sh
tools/update.sh

index b3df405..8e00787 100644 (file)
@@ -18,6 +18,7 @@ TOPDIR=$(shell readlink -f .|sed -e 's/\/descriptor-packages\/.*//')
 TOOLS_DIR := $(TOPDIR)/tools
 
 SUBDIRS_CLEAN = $(addsuffix .clean, $(SUBDIRS))
+SUBDIRS_TEST = $(addsuffix .test, $(SUBDIRS))
 
 .PHONY: $(SUBDIRS) $(SUBDIRS_CLEAN) clean
 
@@ -25,9 +26,14 @@ all: $(SUBDIRS)
 
 clean: $(SUBDIRS_CLEAN)
 
+test: $(SUBDIRS_TEST)
+
 $(SUBDIRS_CLEAN): %.clean:
        @$(MAKE) --no-print-directory -C $* clean
 
+$(SUBDIRS_TEST): %.test:
+       @$(MAKE) --no-print-directory -C $* test
+
 $(SUBDIRS):
        @$(MAKE) --no-print-directory -C $@
 
index 9c623c4..eb9711f 100644 (file)
@@ -31,6 +31,7 @@ Q=@
 GEN_VNFD_PKG := $(TOOLS_DIR)/gen_vnfd_pkg.sh
 GEN_NSD_PKG  := $(TOOLS_DIR)/gen_nsd_pkg.sh
 GEN_PKG      := $(TOOLS_DIR)/generate_descriptor_pkg.sh
+TEST_PKG     := $(TOOLS_DIR)/upgrade_descriptor_version.py
 BUILD_VNFD   := $(shell readlink -f .|sed -e 's/\/.*descriptor-packages//' | grep vnfd)
 
 DEP_FILES = $(wildcard src/*)
@@ -73,4 +74,9 @@ clean:
        $(Q)rm -rf $(BUILD_DIR)
        $(Q)rm -rf $(CHARM_BUILD_DIR)
 
+test:
+       $(Q)echo -n testing $(shell readlink -f src/*.yaml)  "             " 
+       $(Q)$(TEST_PKG) --test src/*.yaml
+       $(Q)echo OK
+        
 .DEFAULT_GOAL := all
index f263e40..b3f4611 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: VyOS
         name: VyOS
@@ -14,8 +14,6 @@ nsd:nsd-catalog:
             short-name: data
             type: ELAN
             vim-network-name: net-corp
-            provider-network:
-                overlay-type: VLAN
             vnfd-connection-point-ref:
             -   member-vnf-index-ref: '1'
                 vnfd-connection-point-ref: eth1
@@ -26,8 +24,6 @@ nsd:nsd-catalog:
             mgmt-network: 'true'
             type: ELAN
             vim-network-name: net-mgmtOS
-            provider-network:
-                overlay-type: VLAN
             vnfd-connection-point-ref:
             -   member-vnf-index-ref: '1'
                 vnfd-connection-point-ref: eth0
@@ -48,4 +44,4 @@ nsd:nsd-catalog:
                 vnfd-name: VyOS
                 primitive:
                 -   index: '1'
-                    name: ping
+                    name: ping
\ No newline at end of file
index 298b834..c573ab1 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: cirros_2vnf_nsd
         name: cirros_2vnf_ns
@@ -30,7 +30,6 @@ nsd:nsd-catalog:
                 mgmt-network: 'true'
                 # vim-network-name: <update>
                 # provider-network:
-                #     overlay-type: VLAN
                 #     segmentation_id: <update>
                 vnfd-connection-point-ref:
                 # Specify the constituent VNFs
index 57ec12b..9e5a23a 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: cirros_noportsecurity_2vnf_nsd
         name: cirros_noportsecurity_2vnf_ns
@@ -30,16 +30,15 @@ nsd:nsd-catalog:
                 mgmt-network: 'true'
                 # vim-network-name: <update>
                 # provider-network:
-                #     overlay-type: VLAN
                 #     segmentation_id: <update>
                 vnfd-connection-point-ref:
                 # Specify the constituent VNFs
                 # member-vnf-index-ref - entry from constituent vnf
                 # vnfd-id-ref - VNFD id
                 # vnfd-connection-point-ref - connection point name in the VNFD
-                -   nsd:member-vnf-index-ref: 1
-                    nsd:vnfd-id-ref: cirros_noportsecurity_vnfd
-                    nsd:vnfd-connection-point-ref: eth0
-                -   nsd:member-vnf-index-ref: 2
-                    nsd:vnfd-id-ref: cirros_noportsecurity_vnfd
-                    nsd:vnfd-connection-point-ref: eth0
+                -   member-vnf-index-ref: 1
+                    vnfd-id-ref: cirros_noportsecurity_vnfd
+                    vnfd-connection-point-ref: eth0
+                -   member-vnf-index-ref: 2
+                    vnfd-id-ref: cirros_noportsecurity_vnfd
+                    vnfd-connection-point-ref: eth0
index d9d7476..5c4e214 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: cirros_nsd
         name: cirros_ns
@@ -37,7 +37,6 @@ nsd:nsd-catalog:
                 mgmt-network: 'true'
                 # vim-network-name: <update>
                 # provider-network:
-                #     overlay-type: VLAN
                 #     segmentation_id: <update>
                 vnfd-connection-point-ref:
                 # Specify the constituent VNFs
index e346830..2fabb3b 100755 (executable)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: cirros_set_vim_network_ns
         name: cirros_set_vim_network_ns
@@ -37,7 +37,6 @@ nsd:nsd-catalog:
                 mgmt-network: 'true'
                 # vim-network-name: <update>
                 # provider-network:
-                #     overlay-type: VLAN
                 #     segmentation_id: <update>
                 vim-network-name: mgmt
                 vnfd-connection-point-ref:
@@ -45,7 +44,7 @@ nsd:nsd-catalog:
                 # member-vnf-index-ref - entry from constituent vnf
                 # vnfd-id-ref - VNFD id
                 # vnfd-connection-point-ref - connection point name in the VNFD
-                -   nsd:member-vnf-index-ref: 1
-                    nsd:vnfd-id-ref: cirros_vnfd
+                -   member-vnf-index-ref: 1
+                    vnfd-id-ref: cirros_vnfd
                     # NOTE: Validate the entry below
-                    nsd:vnfd-connection-point-ref: eth0
+                    vnfd-connection-point-ref: eth0
index d42568c..a6b4a0d 100755 (executable)
@@ -1,19 +1,18 @@
 nsd:nsd-catalog:
-    nsd:nsd:
-    -   nsd:constituent-vnfd:
-        -   nsd:member-vnf-index: '1'
-            nsd:start-by-default: 'true'
-            nsd:vnfd-id-ref: dns_forwarder
-        nsd:id: dns_forwarder_ns
-        nsd:logo: dns.jpg
-        nsd:name: dns_forwarder_ns
-        nsd:vld:
-        -   nsd:id: management
-            nsd:mgmt-network: 'true'
-            nsd:name: management
-            nsd:vim-network-name: subnet-8a91b2c0
-            nsd:vnfd-connection-point-ref:
-            -   nsd:member-vnf-index-ref: '1'
-                nsd:vnfd-connection-point-ref: eth0
-                nsd:vnfd-id-ref: dns_forwarder
-        rw-nsd:meta: '{"containerPositionMap":{"1":{"top":210.5,"left":248,"right":498,"bottom":265.5,"width":250,"height":55},"ada27681-7f3e-4768-8be8-41973f849066":{"top":30,"left":135,"right":385,"bottom":85,"width":250,"height":55},"vld-1":{"top":60,"left":495,"right":745,"bottom":98,"width":250,"height":38},"management":{"top":90,"left":480,"right":730,"bottom":128,"width":250,"height":38}}}'
+    nsd:
+    -   constituent-vnfd:
+        -   member-vnf-index: '1'
+            start-by-default: 'true'
+            vnfd-id-ref: dns_forwarder
+        id: dns_forwarder_ns
+        logo: dns.jpg
+        name: dns_forwarder_ns
+        vld:
+        -   id: management
+            mgmt-network: 'true'
+            name: management
+            vim-network-name: subnet-8a91b2c0
+            vnfd-connection-point-ref:
+            -   member-vnf-index-ref: '1'
+                vnfd-connection-point-ref: eth0
+                vnfd-id-ref: dns_forwarder
index 01103f4..3124886 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   id: IMS-corpA
         name: IMS-corpA
@@ -15,7 +15,6 @@ nsd:nsd-catalog:
             type: ELAN
             vim-network-name: net-corp:108
             provider-network:
-                overlay-type: VLAN
                 physical-network: net-corp
                 segmentation_id: '108'
             vnfd-connection-point-ref:
@@ -28,8 +27,6 @@ nsd:nsd-catalog:
             short-name: management
             type: ELAN
             vim-network-name: net-mgmtOS
-            provider-network:
-                overlay-type: VLAN
             vnfd-connection-point-ref:
             -   member-vnf-index-ref: '1'
                 vnfd-connection-point-ref: eth1
@@ -58,4 +55,4 @@ nsd:nsd-catalog:
                 vnfd-name: cwims_vnfd
                 primitive:
                 -   index: '1'
-                    name: delete-user
+                    name: delete-user
\ No newline at end of file
index ec13b26..bec5997 100644 (file)
@@ -15,7 +15,7 @@
 #
 #
 
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
      -  id: rift_ping_pong_ns
         logo: rift_logo.png
index 161fc58..d8c3813 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   constituent-vnfd:
         -   member-vnf-index: '1'
index 974e2af..6f67ed2 100644 (file)
@@ -1,4 +1,4 @@
-nsd:nsd-catalog:
+nsd-catalog:
     nsd:
     -   constituent-vnfd:
         -   member-vnf-index: '1'
index e768c77..fa9a567 100755 (executable)
@@ -1,19 +1,19 @@
-nsd:nsd-catalog:
-    nsd:nsd:
-    -   nsd:constituent-vnfd:
-        -   nsd:member-vnf-index: '1'
-            nsd:start-by-default: 'true'
-            nsd:vnfd-id-ref: ubuntu_1iface_cloudinit_newfile_vnfd
-        nsd:id: ubuntu_cloudinit
-        nsd:name: ubuntu_cloudinit
-        nsd:short-name: ubuntu_cloudinit
-        nsd:vld:
-        -   nsd:id: mgmt
-            nsd:mgmt-network: 'false'
-            nsd:name: mgmt
-            nsd:short-name: mgmt
+nsd-catalog:
+    nsd:
+    -   constituent-vnfd:
+        -   member-vnf-index: '1'
+            start-by-default: 'true'
+            vnfd-id-ref: ubuntu_1iface_cloudinit_newfile_vnfd
+        id: ubuntu_cloudinit
+        name: ubuntu_cloudinit
+        short-name: ubuntu_cloudinit
+        vld:
+        -   id: mgmt
+            mgmt-network: 'false'
+            name: mgmt
+            short-name: mgmt
             mgmt-network: 'true'
-            nsd:vnfd-connection-point-ref:
-            -   nsd:member-vnf-index-ref: '1'
-                nsd:vnfd-connection-point-ref: eth0
-                nsd:vnfd-id-ref: ubuntu_1iface_cloudinit_newfile_vnfd
+            vnfd-connection-point-ref:
+            -   member-vnf-index-ref: '1'
+                vnfd-connection-point-ref: eth0
+                vnfd-id-ref: ubuntu_1iface_cloudinit_newfile_vnfd
index 4259ece..e07aaee 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 
 ##
 # under the License.
 #
 ##
-
+from __future__ import print_function
 import json
 import yaml
 # import logging
 import sys
 import getopt
 
-
 """
 Converts OSM VNFD, NSD descriptor from release TWO to release THREE format
 """
-__author__ = "Alfonso Tierno"
+__author__ = "Alfonso Tierno, Guillermo Calvino"
 __date__ = "2017-10-14"
-__version__ = "0.0.1"
+__version__ = "0.0.2"
 version_date = "Nov 2017"
 
 
@@ -47,7 +46,7 @@ def usage():
     print("      -h|--help: shows this help")
     print("      -i|--input FILE: (same as param FILE) descriptor file to be upgraded")
     print("      -o|--output FILE: where to write generated descriptor. By default stdout")
-    print("      --test: Content is tested to check wrong format or unknown keys")
+    print("      --test: Content is tested to check wrong format or unknown keys")
     return
 
 
@@ -80,6 +79,7 @@ if __name__=="__main__":
     input_file_name = None
     output_file_name = None
     test_file = None
+    file_name = None
     try:
         # load parameters and configuration
         opts, args = getopt.getopt(sys.argv[1:], "hvi:o:", ["input=", "help", "version", "output=", "test",])
@@ -113,6 +113,7 @@ if __name__=="__main__":
             output = open(file_name, 'w')
         else:
             output = sys.stdout
+        file_name = None
 
         if input_file_name.endswith('.yaml') or input_file_name.endswith('.yml') or not \
             (input_file_name.endswith('.json') or '\t' in descriptor_str):
@@ -121,28 +122,70 @@ if __name__=="__main__":
             data = json.loads(descriptor_str)
             format_output_yaml = False
 
+        if test_file:
+            import osm_im.vnfd as vnfd_catalog
+            import osm_im.nsd as nsd_catalog
+            from pyangbind.lib.serialise import pybindJSONDecoder
+
+            if "vnfd:vnfd-catalog" in data or "vnfd-catalog" in data:
+                descriptor = "VNF"
+                myvnfd = vnfd_catalog.vnfd()
+                pybindJSONDecoder.load_ietf_json(data, None, None, obj=myvnfd)
+            elif "nsd:nsd-catalog" in data or "nsd-catalog" in data:
+                descriptor = "NS"
+                mynsd = nsd_catalog.nsd()
+                pybindJSONDecoder.load_ietf_json(data, None, None, obj=mynsd)
+            else:
+                descriptor = None
+                raise KeyError("This is not neither nsd-catalog nor vnfd-catalog descriptor")
+            exit(0)
+
         # Convert version
         if "vnfd:vnfd-catalog" in data or "vnfd-catalog" in data:
             remove_prefix(data, "vnfd:")
             error_position.append("vnfd-catalog")
             vnfd_descriptor = data["vnfd-catalog"]
-
             vnfd_list = vnfd_descriptor["vnfd"]
             error_position.append("vnfd")
             for vnfd in vnfd_list:
                 error_position[-1] = "vnfd[{}]".format(vnfd["id"])
-
                 # Remove vnf-configuration:config-attributes
                 if "vnf-configuration" in vnfd and "config-attributes" in vnfd["vnf-configuration"]:
                     del vnfd["vnf-configuration"]["config-attributes"]
+                # Remove interval-vld:vendor
+                if "internal-vld" in vnfd:
+                    internal_vld_list = vnfd.get("internal-vld", ())
+                    for internal_vld in internal_vld_list:
+                        if "vendor" in internal_vld:
+                            del internal_vld["vendor"]
+                # Remove "rw-nsd:meta"
+                if "rw-vnfd:meta" in vnfd:
+                    del vnfd["rw-vnfd:meta"]
+                # Change vnf-configuration:service-primitive into vnf-configuration:config-primitive
+                if "vnf-configuration" in vnfd and "service-primitive" in vnfd["vnf-configuration"]:
+                    vnfd["vnf-configuration"]["config-primitive"] = vnfd["vnf-configuration"].pop("service-primitive")
+
+                #Convert to capital letters vnf-configuration:service-primitive:parameter:data-type
+                if "vnf-configuration" in vnfd and "config-primitive" in vnfd["vnf-configuration"]:
+                    error_position.append("vnf-configuration")
+                    error_position.append("config-primitive")
+                    primitive_list = vnfd["vnf-configuration"].get("config-primitive", ())
 
+                    for primitive in primitive_list:
+                        if "parameter" in primitive:
+                            parameter_list = primitive.get("parameter", ())
+                            for parameter in parameter_list:
+                                parameter["data-type"] = str(parameter["data-type"]).upper()
+
+                    vnfd["vnf-configuration"]["config-primitive"] = primitive_list
+                    error_position.pop()
+                    error_position.pop()
                 # Iterate with vdu:interfaces
                 vdu_list = vnfd["vdu"]
                 error_position.append("vdu")
                 for vdu in vdu_list:
                     error_position[-1] = "vdu[{}]".format(vdu["id"])
-
-                    # Change exernal/internal interface
+                    # Change external/internal interface
                     interface_list = []
                     external_interface_list = vdu.pop("external-interface", ())
                     error_position.append("external-interface")
@@ -153,7 +196,6 @@ if __name__=="__main__":
                             external_interface.pop("vnfd-connection-point-ref")
                         interface_list.append(external_interface)
                     error_position.pop()
-
                     internal_interface_list = vdu.pop("internal-interface", ())
                     error_position.append("internal-interface")
                     for internal_interface in internal_interface_list:
@@ -163,7 +205,6 @@ if __name__=="__main__":
                             internal_interface.pop("vdu-internal-connection-point-ref")
                         interface_list.append(internal_interface)
                     error_position.pop()
-
                     if interface_list:
                         vdu["interface"] = interface_list
                 error_position.pop()
@@ -181,6 +222,22 @@ if __name__=="__main__":
                 # Change initial-config-primitive into initial-service-primitive
                 if "initial-config-primitive" in nsd:
                     nsd['initial-service-primitive'] = nsd.pop("initial-config-primitive")
+                # Remove "rw-nsd:meta"
+                if "rw-nsd:meta" in nsd:
+                    del nsd["rw-nsd:meta"]
+                # Remove "rw-meta"
+                if "rw-meta" in nsd:
+                    del nsd["rw-meta"]
+                # Iterate with vld:id
+                error_position.append("vld")
+                vld_list = nsd.get("vld",())
+                for vld in vld_list:
+                    error_position[-1] = "vld[{}]".format(vld["id"])
+                    if "provider-network" in vld and "overlay-type" in vld["provider-network"]:
+                        del vld["provider-network"]["overlay-type"]
+                error_position.pop()
+                if vld_list:
+                    nsd["vld"] = vld_list
             error_position = []
         else:
             error_position = ["global"]
@@ -190,6 +247,7 @@ if __name__=="__main__":
             yaml.dump(data, output, indent=4, default_flow_style=False)
         else:
             json.dump(data, output)
+        exit(0)
 
     except yaml.YAMLError as exc:
         error_pos = ""
@@ -198,16 +256,26 @@ if __name__=="__main__":
             error_pos = "at line:%s column:%s" % (mark.line + 1, mark.column + 1)
         print("Error loading file '{}'. yaml format error {}".format(input_file_name, error_pos), file=sys.stderr)
 
-    except json.decoder.JSONDecodeError as e:
-        print("Invalid field at configuration file '{file}' {message}".format(file=input_file_name, message=str(e)),
-              file=sys.stderr)
+#    except json.decoder.JSONDecodeError as e:
+#        print("Invalid field at configuration file '{file}' {message}".format(file=input_file_name, message=str(e)),
+#              file=sys.stderr)
     except ArgumentParserError as e:
         print(str(e), file=sys.stderr)
     except IOError as e:
-        print("Error loading file '{}': {}".format(file_name, e), file=sys.stderr)
+            print("Error loading file '{}': {}".format(file_name, e), file=sys.stderr)
+    except ImportError as e:
+        print ("Package python-osm-im not installed: {}".format(e), file=sys.stderr)
     except Exception as e:
-        if error_position:
+        if test_file:
+            if descriptor:
+                print("Error. Invalid {} descriptor format in '{}': {}".format(descriptor, input_file_name, str(e)), file=sys.stderr)
+            else:
+                print("Error. Invalid descriptor format in '{}': {}".format(input_file_name, str(e)),
+                      file=sys.stderr)
+        elif error_position:
             print("Descriptor error at '{}': {}".format(":".join(error_position), e), file=sys.stderr)
+        elif file_name:
+            print ("Error loading file '{}': {}".format(file_name, str(e)), file=sys.stderr)
         else:
             raise
             # print("Unexpected exception {}".format(e), file=sys.stderr)
index b115d91..1d7689b 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   id: VyOS
         name: VyOS
@@ -8,7 +8,7 @@ vnfd:vnfd-catalog:
         mgmt-interface:
             cp: eth0
         vnf-configuration:
-            service-primitive:
+            config-primitive:
             -   name: config
                 parameter:
                 -   name: user
index d34414e..ed8900b 100755 (executable)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   id: cirros_noportsecurity_vnfd
         name: cirros_noportsecurity_vnf
@@ -29,7 +29,7 @@ vnfd:vnfd-catalog:
                 storage-gb: 2
 
             # Image/checksum or image including the full path
-            image: 'CirrOS 0.3.4 64-bit'
+            image: 'cirros034'
             #checksum: 
 
             interface:
index ee30fb3..94fa5f1 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   id: cirros_vnfd
         name: cirros_vnf
@@ -29,7 +29,7 @@ vnfd:vnfd-catalog:
                 storage-gb: 2
 
             # Image/checksum or image including the full path
-            image: 'cirros-0.3.5-x86_64-disk.img'
+            image: 'cirros034'
             #checksum: 
 
             interface:
index 8a5f40f..25b7e83 100755 (executable)
@@ -1,39 +1,38 @@
-vnfd:vnfd-catalog:
-    vnfd:vnfd:
-    -   rw-vnfd:meta: '{"containerPositionMap":{"dns_forwarder":{"top":30,"left":260,"right":510,"bottom":85,"width":250,"height":55},"dns_forwarder/dns_forwarder-VM":{"top":130,"left":260,"right":510,"bottom":185,"width":250,"height":55}}}'
-        vnfd:connection-point:
-        -   vnfd:name: eth0
-            vnfd:type: VPORT
-        vnfd:description: Simple VNF example with a DNS forwarder
-        vnfd:id: dns_forwarder
-        vnfd:logo: dns.jpg
-        vnfd:mgmt-interface:
-            vnfd:cp: eth0
-        vnfd:name: dns_forwarder
-        vnfd:service-function-chain: UNAWARE
-        vnfd:short-name: dns_forwarder
-        vnfd:vdu:
-        -   vnfd:count: '1'
-            vnfd:description: dns_forwarder-VM
-            vnfd:interface:
-            -   vnfd:name: eth0
-                vnfd:type: EXTERNAL
-                vnfd:virtual-interface:
-                    vnfd:bandwidth: '0'
-                    vnfd:type: VIRTIO
-                    vnfd:vpci: 0000:00:0a.0
-                vnfd:external-connection-point-ref: eth0
-            vnfd:guest-epa:
-                vnfd:cpu-pinning-policy: ANY
-            vnfd:id: dns_forwarder-VM
-            vnfd:image: ubuntu/images/hvm-ssd/ubuntu-zesty-17.04-amd64-server-20170619.1
-            vnfd:cloud-init-file: cloud_init.cfg
-            vnfd:name: dns_forwarder-VM
-            vnfd:supplemental-boot-data:
-                vnfd:boot-data-drive: 'false'
-            vnfd:vm-flavor:
-                vnfd:memory-mb: '1024'
-                vnfd:storage-gb: '1'
-                vnfd:vcpu-count: '1'
-        vnfd:vendor: OSM
-        vnfd:version: '1.0'
+vnfd-catalog:
+    vnfd:
+    -   connection-point:
+        -   name: eth0
+            type: VPORT
+        description: Simple VNF example with a DNS forwarder
+        id: dns_forwarder
+        logo: dns.jpg
+        mgmt-interface:
+            cp: eth0
+        name: dns_forwarder
+        service-function-chain: UNAWARE
+        short-name: dns_forwarder
+        vdu:
+        -   count: '1'
+            description: dns_forwarder-VM
+            interface:
+            -   name: eth0
+                type: EXTERNAL
+                virtual-interface:
+                    bandwidth: '0'
+                    type: VIRTIO
+                    vpci: 0000:00:0a.0
+                external-connection-point-ref: eth0
+            guest-epa:
+                cpu-pinning-policy: ANY
+            id: dns_forwarder-VM
+            image: ubuntu/images/hvm-ssd/ubuntu-zesty-17.04-amd64-server-20170619.1
+            cloud-init-file: cloud_init.cfg
+            name: dns_forwarder-VM
+            supplemental-boot-data:
+                boot-data-drive: 'false'
+            vm-flavor:
+                memory-mb: '1024'
+                storage-gb: '1'
+                vcpu-count: '1'
+        vendor: OSM
+        version: '1.0'
index 2b859ae..fb903fc 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   id: IMS-ALLIN1_2p
         name: IMS-ALLIN1_2p
@@ -8,7 +8,7 @@ vnfd:vnfd-catalog:
         mgmt-interface:
             cp: eth1
         vnf-configuration:
-            service-primitive:
+            config-primitive:
             -   name: config
                 parameter:
                 -   name: home_domain
@@ -16,7 +16,7 @@ vnfd:vnfd-catalog:
                     mandatory: 'true'
                     default-value: ims.com
                 -   name: password
-                    data-type: string
+                    data-type: STRING
                     mandatory: 'true'
                     default-value: cw-aio
             -   name: create-update-user
index bfea210..0639419 100644 (file)
@@ -15,7 +15,7 @@
 #
 #
 
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
      -  id: rift_ping_vnf
         name: ping_vnf
@@ -38,12 +38,12 @@ vnfd:vnfd-catalog:
                 port: '18888'
             port: '18888'
             cp: ping_vnfd/cp0
-        placement-groups:
-        -   member-vdus:
-            -   member-vdu-ref: iovdu_0
-            name: Eris
-            requirement: Place this VM on the Kuiper belt object Eris
-            strategy: COLOCATION
+        placement-groups:
+        -   member-vdus:
+            -   member-vdu-ref: iovdu_0
+            name: Eris
+            requirement: Place this VM on the Kuiper belt object Eris
+            strategy: COLOCATION
         vdu:
         -   cloud-init-file: ping_cloud_init.cfg
             count: '1'
index 536198b..4dfbab0 100644 (file)
@@ -15,7 +15,7 @@
 #
 #
 
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
      -  id: rift_pong_vnf
         name: pong_vnf
@@ -38,12 +38,12 @@ vnfd:vnfd-catalog:
                 port: '18889'
             port: '18889'
             cp: pong_vnfd/cp0
-        placement-groups:
-        -   member-vdus:
-            -   member-vdu-ref: iovdu_0
-            name: Weywot
-            requirement: Place this VM on the Kuiper belt object Weywot
-            strategy: COLOCATION
+        placement-groups:
+        -   member-vdus:
+            -   member-vdu-ref: iovdu_0
+            name: Weywot
+            requirement: Place this VM on the Kuiper belt object Weywot
+            strategy: COLOCATION
         vdu:
         -   cloud-init-file: pong_cloud_init.cfg
             count: '1'
index 3d8f7ce..d1b7840 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   connection-point:
         -   name: mgmt0
@@ -17,7 +17,6 @@ vnfd:vnfd-catalog:
             name: VL12
             short-name: VL12
             type: ELAN
-            vendor: ETSI
             internal-connection-point:
             -   id-ref: 'iface11'
             -   id-ref: 'iface21'
index bdb2386..ae534a8 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   connection-point:
         -   name: mgmt0
@@ -19,7 +19,6 @@ vnfd:vnfd-catalog:
             name: VL34
             short-name: VL34
             type: ELAN
-            vendor: ETSI
             internal-connection-point:
             -   id-ref: 'iface31'
             -   id-ref: 'iface41'
index 9284b8e..58cd499 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   connection-point:
         -   name: mgmt
index 5a1a46d..02987b1 100644 (file)
@@ -1,4 +1,4 @@
-vnfd:vnfd-catalog:
+vnfd-catalog:
     vnfd:
     -   connection-point:
         -   name: mgmt
index 1bb4257..947c637 100755 (executable)
@@ -17,23 +17,28 @@ function usage(){
     echo -e "usage: $0 [OPTIONS]"
     echo -e "Install OSM from binaries or source code (by default, from binaries)"
     echo -e "  OPTIONS"
-    echo -e "     --uninstall:   uninstall OSM: remove the containers and delete NAT rules"
-    echo -e "     --source:      install OSM from source code using the latest stable tag"
+    echo -e "     --uninstall:    uninstall OSM: remove the containers and delete NAT rules"
+    echo -e "     --source:       install OSM from source code using the latest stable tag"
     echo -e "     -r <repo>:      use specified repository name for osm packages"
-    echo -e "     -R <release>:   use specified release for osm packages"
+    echo -e "     -R <release>:   use specified release for osm binaries (deb packages, lxd images, ...)"
     echo -e "     -u <repo base>: use specified repository url for osm packages"
     echo -e "     -k <repo key>:  use specified repository public key url"
-    echo -e "     -b <refspec>:  install OSM from source code using a specific branch (master, v2.0, ...) or tag"
-    echo -e "                    -b master          (main dev branch)"
-    echo -e "                    -b v2.0            (v2.0 branch)"
-    echo -e "                    -b tags/v1.1.0     (a specific tag)"
-    echo -e "                    ..."
-    echo -e "     --develop:     (deprecated, use '-b master') install OSM from source code using the master branch"
-    echo -e "     --nat:         install only NAT rules"
-#    echo -e "     --update:      update to the latest stable release or to the latest commit if using a specific branch"
-    echo -e "     --showopts:    print chosen options and exit (only for debugging)"
-    echo -e "     -y:            do not prompt for confirmation, assumes yes"
-    echo -e "     -h / --help:   print this help"
+    echo -e "     -b <refspec>:   install OSM from source code using a specific branch (master, v2.0, ...) or tag"
+    echo -e "                     -b master          (main dev branch)"
+    echo -e "                     -b v2.0            (v2.0 branch)"
+    echo -e "                     -b tags/v1.1.0     (a specific tag)"
+    echo -e "                     ..."
+    echo -e "     --lxdimages:    download lxd images from OSM repository instead of creating them from scratch"
+    echo -e "     -l <lxd_repo>:  use specified repository url for lxd images"
+    echo -e "     --vimemu:       additionally fetch, build, and deploy the VIM emulator as a docker container"
+    echo -e "     --develop:      (deprecated, use '-b master') install OSM from source code using the master branch"
+#    echo -e "     --reconfigure:  reconfigure the modules (DO NOT change NAT rules)"
+    echo -e "     --nat:          install only NAT rules"
+    echo -e "     --noconfigure:  DO NOT install osmclient, DO NOT install NAT rules, DO NOT configure modules"
+#    echo -e "     --update:       update to the latest stable release or to the latest commit if using a specific branch"
+    echo -e "     --showopts:     print chosen options and exit (only for debugging)"
+    echo -e "     -y:             do not prompt for confirmation, assumes yes"
+    echo -e "     -h / --help:    print this help"
 }
 
 #Uninstall OSM: remove containers
@@ -139,7 +144,11 @@ function update(){
 }
 
 function so_is_up() {
-    SO_IP=$1
+    if [ -n "$1" ]; then
+        SO_IP=$1
+    else
+        SO_IP=`lxc list SO-ub -c 4|grep eth0 |awk '{print $2}'`
+    fi
     time=0
     step=5
     timelength=300
@@ -159,39 +168,70 @@ function so_is_up() {
         time=$((time+step))
     done
 
-    FATAL "OSM Failed to startup"
+    FATAL "OSM Failed to startup. SO failed to startup"
 }
 
-#Configure VCA, SO and RO with the initial configuration:
-#  RO -> tenant:osm, logs to be sent to SO
-#  VCA -> juju-password
-#  SO -> route to Juju Controller, add RO account, add VCA account
-function configure(){
-    #Configure components
-    echo -e "\nConfiguring components"
-    . $OSM_DEVOPS/installers/export_ips
+function vca_is_up() {
+    if [[ `lxc exec VCA -- juju status | grep "osm" | wc -l` -eq 1 ]]; then
+            echo "VCA is up and running"
+            return 0
+    fi
+
+    FATAL "OSM Failed to startup. VCA failed to startup"
+}
+
+function ro_is_up() {
+    if [ -n "$1" ]; then
+        RO_IP=$1
+    else
+        RO_IP=`lxc list RO -c 4|grep eth0 |awk '{print $2}'`
+    fi
+    time=0
+    step=2
+    timelength=20
+    while [ $time -le $timelength ]; do
+        if [[ `curl http://$RO_IP:9090/openmano/ | grep "works" | wc -l` -eq 1 ]]; then
+            echo "RO is up and running"
+            return 0
+        fi
+        sleep $step
+        echo -n "."
+        time=$((time+step))
+    done
 
+    FATAL "OSM Failed to startup. RO failed to startup"
+}
+
+
+function configure_RO(){
+    . $OSM_DEVOPS/installers/export_ips
     echo -e "       Configuring RO"
     lxc exec RO -- sed -i -e "s/^\#\?log_socket_host:.*/log_socket_host: $SO_CONTAINER_IP/g" /etc/osm/openmanod.cfg
     lxc exec RO -- service osm-ro restart
 
-    time=0; step=2; timelength=20; while [ $time -le $timelength ]; do sleep $step; echo -n "."; time=$((time+step)); done; echo
+    ro_is_up
 
     lxc exec RO -- openmano tenant-delete -f osm >/dev/null
-    RO_TENANT_ID=`lxc exec RO -- openmano tenant-create osm |awk '{print $1}'`
+    lxc exec RO -- openmano tenant-create osm > /dev/null
     lxc exec RO -- sed -i '/export OPENMANO_TENANT=osm/d' .bashrc 
     lxc exec RO -- sed -i '$ i export OPENMANO_TENANT=osm' .bashrc
-    #lxc exec RO -- sh -c 'echo "export OPENMANO_TENANT=osm" >> .bashrc'
+    lxc exec RO -- sh -c 'echo "export OPENMANO_TENANT=osm" >> .bashrc'
+}
 
+function configure_VCA(){
     echo -e "       Configuring VCA"
     JUJU_PASSWD=`date +%s | sha256sum | base64 | head -c 32`
     echo -e "$JUJU_PASSWD\n$JUJU_PASSWD" | lxc exec VCA -- juju change-user-password
+}
+
+function configure_SOUI(){
+    . $OSM_DEVOPS/installers/export_ips
     JUJU_CONTROLLER_IP=`lxc exec VCA -- lxc list -c 4 |grep eth0 |awk '{print $2}'`
+    RO_TENANT_ID=`lxc exec RO -- openmano tenant-list osm |awk '{print $1}'`
 
     echo -e "       Configuring SO"
     sudo route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP
     sudo sed -i "$ i route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP" /etc/rc.local
-
     # make journaling persistent
     lxc exec SO-ub -- mkdir -p /var/log/journal
     lxc exec SO-ub -- systemd-tmpfiles --create --prefix /var/log/journal
@@ -263,16 +303,34 @@ iface lo:1 inet static
         netmask 255.255.255.255
 EOF
     lxc exec SO-ub ifup lo:1
+}
 
+#Configure RO, VCA, and SO with the initial configuration:
+#  RO -> tenant:osm, logs to be sent to SO
+#  VCA -> juju-password
+#  SO -> route to Juju Controller, add RO account, add VCA account
+function configure(){
+    #Configure components
+    echo -e "\nConfiguring components"
+    configure_RO
+    configure_VCA
+    configure_SOUI
 }
 
 function install_lxd() {
+    sudo apt-get update
+    sudo apt-get install -y lxd
+    newgrp lxd
     lxd init --auto
     lxd waitready
-    systemctl stop lxd-bridge
-    systemctl --system daemon-reload
-    systemctl enable lxd-bridge
-    systemctl start lxd-bridge
+    lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
+    DEFAULT_INTERFACE=$(route -n | awk '$1~/^0.0.0.0/ {print $8}')
+    DEFAULT_MTU=$( ip addr show $DEFAULT_INTERFACE | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
+    lxc profile device set default eth0 mtu $DEFAULT_MTU
+    #sudo systemctl stop lxd-bridge
+    #sudo systemctl --system daemon-reload
+    #sudo systemctl enable lxd-bridge
+    #sudo systemctl start lxd-bridge
 }
 
 function ask_user(){
@@ -289,20 +347,157 @@ function ask_user(){
     done
 }
 
+function launch_container_from_lxd(){
+    export OSM_MDG=$1
+    OSM_load_config
+    export OSM_BASE_IMAGE=$2
+    if ! container_exists $OSM_BUILD_CONTAINER; then
+        CONTAINER_OPTS=""
+        [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
+        [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
+        create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
+        wait_container_up $OSM_BUILD_CONTAINER
+    fi
+}
+
+function install_osmclient(){
+    CLIENT_RELEASE=${RELEASE#"-R "}
+    CLIENT_REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg"
+    CLIENT_REPOSITORY="stable"
+    [ -z "$REPOSITORY_BASE" ] && REPOSITORY_BASE="-u https://osm-download.etsi.org/repository/osm/debian"
+    CLIENT_REPOSITORY_BASE=${REPOSITORY_BASE#"-u "}
+    key_location=$CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE/$CLIENT_REPOSITORY_KEY
+    curl $key_location | sudo apt-key add -
+    sudo add-apt-repository -y "deb [arch=amd64] $CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE $CLIENT_REPOSITORY osmclient"
+    sudo apt-get update
+    sudo apt-get install -y python-osmclient
+    export OSM_HOSTNAME=`lxc list | awk '($2=="SO-ub"){print $6}'`
+    export OSM_RO_HOSTNAME=`lxc list | awk '($2=="RO"){print $6}'`
+    echo -e "\nOSM client installed"
+    echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
+    echo "     export OSM_HOSTNAME=${OSM_HOSTNAME}"
+    echo "     export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
+}
+
+function install_from_lxdimages(){
+    LXD_RELEASE=${RELEASE#"-R "}
+    LXD_IMAGE_DIR="$(mktemp -d -q --tmpdir "osmimages.XXXXXX")"
+    trap 'rm -rf "$LXD_IMAGE_DIR"' EXIT
+    wget -O $LXD_IMAGE_DIR/osm-ro.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-ro.tar.gz
+    lxc image import $LXD_IMAGE_DIR/osm-ro.tar.gz --alias osm-ro
+    rm -f $LXD_IMAGE_DIR/osm-ro.tar.gz
+    wget -O $LXD_IMAGE_DIR/osm-vca.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-vca.tar.gz
+    lxc image import $LXD_IMAGE_DIR/osm-vca.tar.gz --alias osm-vca
+    rm -f $LXD_IMAGE_DIR/osm-vca.tar.gz
+    wget -O $LXD_IMAGE_DIR/osm-soui.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-soui.tar.gz
+    lxc image import $LXD_IMAGE_DIR/osm-soui.tar.gz --alias osm-soui
+    rm -f $LXD_IMAGE_DIR/osm-soui.tar.gz
+    launch_container_from_lxd RO osm-ro
+    ro_is_up && track RO
+    launch_container_from_lxd VCA osm-vca
+    vca_is_up && track VCA
+    launch_container_from_lxd SO osm-soui
+    #so_is_up && track SOUI
+    track SOUI
+}
+
+function install_docker_ce() {
+    # installs and configures Docker CE
+    echo "Installing Docker CE ..."
+    sudo apt-get -qq update
+    sudo apt-get install -y apt-transport-https ca-certificates software-properties-common
+    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
+    sudo apt-get -qq update
+    sudo apt-get install -y docker-ce
+    echo "Adding user to group 'docker'"
+    sudo groupadd -f docker
+    sudo usermod -aG docker $USER
+    echo "... Docker CE installation done"
+    sleep 2
+    sudo service docker restart
+    echo "... restarted Docker service"
+}
+
+function install_vimemu() {
+    # install Docker
+    install_docker_ce
+    # clone vim-emu repository (attention: branch is currently master only)
+    echo "Cloning vim-emu repository ..."
+    git clone https://osm.etsi.org/gerrit/osm/vim-emu.git
+    # build vim-emu docker
+    echo "Building vim-emu Docker container..."
+    sudo docker build -t vim-emu-img -f vim-emu/Dockerfile vim-emu/
+    # start vim-emu container as daemon
+    echo "Starting vim-emu Docker container 'vim-emu' ..."
+    sudo docker run --name vim-emu -t -d --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-img python examples/osm_default_daemon_topology_2_pop.py
+    echo "Waiting for 'vim-emu' container to start ..."
+    sleep 5
+    export VIMEMU_HOSTNAME=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vim-emu)
+    echo "vim-emu running at $VIMEMU_HOSTNAME ..."
+    echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
+    echo "     export OSM_HOSTNAME=${OSM_HOSTNAME}"
+    echo "     export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
+    echo -e "You might be interested in adding the following vim-emu env variables to your .bashrc file:"
+    echo "     export VIMEMU_HOSTNAME=${VIMEMU_HOSTNAME}"
+    echo -e "\nTo add the emulated VIM to OSM you should do:"
+    echo "     osm vim-create --name emu-vim1 --user username --password password --auth_url http://$VIMEMU_HOSTNAME:6001/v2.0 --tenant tenantName --account_type openstack"
+}
+
+function dump_vars(){
+    echo "DEVELOP=$DEVELOP"
+    echo "INSTALL_FROM_SOURCE=$INSTALL_FROM_SOURCE"
+    echo "UNINSTALL=$UNINSTALL"
+    echo "NAT=$NAT"
+    echo "UPDATE=$UPDATE"
+    echo "RECONFIGURE=$RECONFIGURE"
+    echo "TEST_INSTALLER=$TEST_INSTALLER"
+    echo "INSTALL_VIMEMU=$INSTALL_VIMEMU"
+    echo "INSTALL_LXD=$INSTALL_LXD"
+    echo "INSTALL_FROM_LXDIMAGES=$INSTALL_FROM_LXDIMAGES"
+    echo "LXD_REPOSITORY_BASE=$LXD_REPOSITORY_BASE"
+    echo "RELEASE=$RELEASE"
+    echo "REPOSITORY=$REPOSITORY"
+    echo "REPOSITORY_BASE=$REPOSITORY_BASE"
+    echo "REPOSITORY_KEY=$REPOSITORY_KEY"
+    echo "NOCONFIGURE=$NOCONFIGURE"
+    echo "SHOWOPTS=$SHOWOPTS"
+    echo "Install from specific refspec (-b): $COMMIT_ID"
+}
+
+function track(){
+    ctime=`date +%s`
+    duration=$((ctime - SESSION_ID))
+    url="http://www.woopra.com/track/ce?project=osm.etsi.org&cookie=${SESSION_ID}"
+    #url="${url}&ce_campaign_name=${CAMPAIGN_NAME}"
+    event_name="bin"
+    [ -n "$INSTALL_FROM_SOURCE" ] && event_name="src"
+    [ -n "$INSTALL_FROM_LXDIMAGES" ] && event_name="lxd"
+    event_name="${event_name}_$1"
+    url="${url}&event=${event_name}&ce_duration=${duration}"
+    wget -q -O /dev/null $url
+}
+
 UNINSTALL=""
 DEVELOP=""
 NAT=""
 UPDATE=""
 RECONFIGURE=""
 TEST_INSTALLER=""
-LXD=""
+INSTALL_LXD=""
 SHOWOPTS=""
 COMMIT_ID=""
 ASSUME_YES=""
 INSTALL_FROM_SOURCE=""
 RELEASE="-R ReleaseTHREE"
-
-while getopts ":hy-:b:r:k:u:R:" o; do
+INSTALL_VIMEMU=""
+INSTALL_FROM_LXDIMAGES=""
+LXD_REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/lxd"
+NOCONFIGURE=""
+RELEASE_DAILY=""
+SESSION_ID=`date +%s`
+
+while getopts ":hy-:b:r:k:u:R:l:" o; do
     case "${o}" in
         h)
             usage && exit 0
@@ -322,6 +517,9 @@ while getopts ":hy-:b:r:k:u:R:" o; do
         u)
             REPOSITORY_BASE="-u ${OPTARG}"
             ;;
+        l)
+            LXD_REPOSITORY_BASE="${OPTARG}"
+            ;;
         -)
             [ "${OPTARG}" == "help" ] && usage && exit 0
             [ "${OPTARG}" == "source" ] && INSTALL_FROM_SOURCE="y" && continue
@@ -331,8 +529,12 @@ while getopts ":hy-:b:r:k:u:R:" o; do
             [ "${OPTARG}" == "update" ] && UPDATE="y" && continue
             [ "${OPTARG}" == "reconfigure" ] && RECONFIGURE="y" && continue
             [ "${OPTARG}" == "test" ] && TEST_INSTALLER="y" && continue
-            [ "${OPTARG}" == "lxd" ] && LXD="y" && continue
+            [ "${OPTARG}" == "lxdinstall" ] && INSTALL_LXD="y" && continue
+            [ "${OPTARG}" == "lxdimages" ] && INSTALL_FROM_LXDIMAGES="y" && continue
+            [ "${OPTARG}" == "vimemu" ] && INSTALL_VIMEMU="y" && continue
+            [ "${OPTARG}" == "noconfigure" ] && NOCONFIGURE="y" && continue
             [ "${OPTARG}" == "showopts" ] && SHOWOPTS="y" && continue
+            [ "${OPTARG}" == "daily" ] && RELEASE_DAILY="y" && continue
             echo -e "Invalid option: '--$OPTARG'\n" >&2
             usage && exit 1
             ;;
@@ -350,19 +552,12 @@ while getopts ":hy-:b:r:k:u:R:" o; do
 done
 
 if [ -n "$SHOWOPTS" ]; then
-    echo "DEVELOP=$DEVELOP"
-    echo "INSTALL_FROM_SOURCE=$INSTALL_FROM_SOURCE"
-    echo "UNINSTALL=$UNINSTALL"
-    echo "NAT=$NAT"
-    echo "UPDATE=$UPDATE"
-    echo "RECONFIGURE=$RECONFIGURE"
-    echo "TEST_INSTALLER=$TEST_INSTALLER"
-    echo "LXD=$LXD"
-    echo "SHOWOPTS=$SHOWOPTS"
-    echo "Install from specific refspec (-b): $COMMIT_ID"
+    dump_vars
     exit 0
 fi
 
+[ -n "$RELEASE_DAILY" ] && echo -e "\nInstalling from daily build repo" && RELEASE="-R ReleaseTHREE-daily" && REPOSITORY="-r testing" && COMMIT_ID="master"
+
 # if develop, we force master
 [ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
 
@@ -398,7 +593,13 @@ LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | sort -V | tail -n1`
 [ -z "$COMMIT_ID" ] && [ -z "$LATEST_STABLE_DEVOPS" ] && echo "Could not find the current latest stable release" && exit 0
 echo "Latest tag in devops repo: $LATEST_STABLE_DEVOPS"
 [ -z "$COMMIT_ID" ] && [ -n "$LATEST_STABLE_DEVOPS" ] && COMMIT_ID="tags/$LATEST_STABLE_DEVOPS"
-[ -z "$TEST_INSTALLER" ] && git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS
+
+if [ -n "$RELEASE_DAILY" ]; then
+    echo "Using master/HEAD devops"
+    git -C $TEMPDIR checkout master
+elif [ -z "$TEST_INSTALLER" ]; then
+    git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS
+fi
 
 OSM_DEVOPS=$TEMPDIR
 OSM_JENKINS="$TEMPDIR/jenkins"
@@ -420,31 +621,54 @@ dpkg -l wget curl tar &>/dev/null || ! echo -e "    One or several packages are
 
 echo -e "Checking required packages: lxd"
 lxd --version &>/dev/null || FATAL "lxd not present, exiting."
-[ -n "$LXD" ] && echo -e "\nConfiguring lxd" && install_lxd
+[ -n "$INSTALL_LXD" ] && echo -e "\nInstalling and configuring lxd" && install_lxd
 
 wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README.txt &> /dev/null
+track start
 
 # use local devops for containers
 export OSM_USE_LOCAL_DEVOPS=true
-if [ -z "$INSTALL_FROM_SOURCE" ]; then
-    echo -e "\nCreating the containers and installing from binaries ..."
-    $OSM_DEVOPS/jenkins/host/install RO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "RO install failed"
-    $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA install failed"
-    $OSM_DEVOPS/jenkins/host/install SO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "SO install failed"
-    $OSM_DEVOPS/jenkins/host/install UI $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "UI install failed"
-else #install from source
+if [ -n "$INSTALL_FROM_SOURCE" ]; then #install from source
     echo -e "\nCreating the containers and building from source ..."
     $OSM_DEVOPS/jenkins/host/start_build RO --notest checkout $COMMIT_ID || FATAL "RO container build failed (refspec: '$COMMIT_ID')"
+    ro_is_up && track RO
     $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA container build failed"
+    vca_is_up && track VCA
     $OSM_DEVOPS/jenkins/host/start_build SO checkout $COMMIT_ID || FATAL "SO container build failed (refspec: '$COMMIT_ID')"
     $OSM_DEVOPS/jenkins/host/start_build UI checkout $COMMIT_ID || FATAL "UI container build failed (refspec: '$COMMIT_ID')"
+    #so_is_up && track SOUI
+    track SOUI
+elif [ -n "$INSTALL_FROM_LXDIMAGES" ]; then #install from LXD images stored in OSM repo
+    echo -e "\nInstalling from lxd images ..."
+    install_from_lxdimages
+else #install from binaries
+    echo -e "\nCreating the containers and installing from binaries ..."
+    $OSM_DEVOPS/jenkins/host/install RO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "RO install failed"
+    ro_is_up && track RO
+    $OSM_DEVOPS/jenkins/host/start_build VCA || FATAL "VCA install failed"
+    vca_is_up && track VCA
+    $OSM_DEVOPS/jenkins/host/install SO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "SO install failed"
+    $OSM_DEVOPS/jenkins/host/install UI $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "UI install failed"
+    #so_is_up && track SOUI
+    track SOUI
 fi
 
 #Install iptables-persistent and configure NAT rules
-nat
+[ -z "$NOCONFIGURE" ] && nat
 
 #Configure components
-configure
+[ -z "$NOCONFIGURE" ] && configure
+
+#Install osmclient
+[ -z "$NOCONFIGURE" ] && install_osmclient
+
+#Install vim-emu (optional)
+if [ -n "$INSTALL_VIMEMU" ]; then
+    echo -e "\nInstalling vim-emu ..."
+    install_vimemu
+fi
 
 wget -q -O- https://osm-download.etsi.org/ftp/osm-3.0-three/README2.txt &> /dev/null
+track end
 echo -e "\nDONE"
+
diff --git a/installers/shim_install_osm.sh b/installers/shim_install_osm.sh
new file mode 100755 (executable)
index 0000000..539f19f
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/bash
+#   Copyright 2017 Telefónica Investigación y Desarrollo S.A.U.
+#
+#   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.
+
+function usage(){
+    echo -e "usage: $0 [OPTIONS]"
+    echo -e "Install OSM from binaries or source code (by default, from binaries)"
+    echo -e "  OPTIONS"
+    echo -e "     --uninstall:    uninstall OSM: remove the containers and delete NAT rules"
+    echo -e "     --source:       install OSM from source code using the latest stable tag"
+    echo -e "     -r <repo>:      use specified repository name for osm packages"
+    echo -e "     -R <release>:   use specified release for osm binaries (deb packages, lxd images, ...)"
+    echo -e "     -u <repo base>: use specified repository url for osm packages"
+    echo -e "     -k <repo key>:  use specified repository public key url"
+    echo -e "     -b <refspec>:   install OSM from source code using a specific branch (master, v2.0, ...) or tag"
+    echo -e "                     -b master          (main dev branch)"
+    echo -e "                     -b v2.0            (v2.0 branch)"
+    echo -e "                     -b tags/v1.1.0     (a specific tag)"
+    echo -e "                     ..."
+    echo -e "     --lxdimages:    download lxd images from OSM repository instead of creating them from scratch"
+    echo -e "     -l <lxd_repo>:  use specified repository url for lxd images"
+    echo -e "     --develop:      (deprecated, use '-b master') install OSM from source code using the master branch"
+#    echo -e "     --reconfigure:  reconfigure the modules (DO NOT change NAT rules)"
+    echo -e "     --nat:          install only NAT rules"
+    echo -e "     --noconfigure:  DO NOT install osmclient, DO NOT install NAT rules, DO NOT configure modules"
+#    echo -e "     --update:       update to the latest stable release or to the latest commit if using a specific branch"
+    echo -e "     --showopts:     print chosen options and exit (only for debugging)"
+    echo -e "     -y:             do not prompt for confirmation, assumes yes"
+    echo -e "     -h / --help:    print this help"
+}
+
+function FATAL() {
+    echo -e $1
+    exit 1
+}
+
+TEST_INSTALLER=""
+LATEST_STABLE_DEVOPS=""
+
+while getopts ":h" o; do
+    case "${o}" in
+        h)
+            usage && exit 0
+            ;;
+        -)
+            [ "${OPTARG}" == "help" ] && usage && exit 0
+            [ "${OPTARG}" == "test" ] && TEST_INSTALLER="y" && continue
+            ;;
+    esac
+done
+
+if [ -n "$TEST_INSTALLER" ]; then
+    echo -e "\nUsing local devops repo for OSM installation"
+    TEMPDIR="$(dirname $(realpath $(dirname $0)))"
+else
+    echo -e "\nCreating temporary dir for OSM installation"
+    TEMPDIR="$(mktemp -d -q --tmpdir "installosm.XXXXXX")"
+    trap 'rm -rf "$TEMPDIR"' EXIT
+fi
+
+if [ -z "$TEST_INSTALLER" ]; then
+    need_packages="git"
+    for package in $need_packages; do
+        echo -e "Checking required packages: $package"
+        dpkg -l $package &>/dev/null \
+            || ! echo -e "     $package not installed.\nInstalling $package requires root privileges" \
+            || sudo apt-get install -y $package \
+            || FATAL "failed to install $package"
+    done
+    echo -e "\nCloning devops repo temporarily"
+    git clone https://osm.etsi.org/gerrit/osm/devops.git $TEMPDIR
+    echo -e "\nGuessing the current stable release"
+    LATEST_STABLE_DEVOPS=`git -C $TEMPDIR tag -l v[0-9].* | sort -V | tail -n1`
+    [ -z "$LATEST_STABLE_DEVOPS" ] && FATAL "Could not find the current latest stable release"
+    echo "Using latest tag in devops repo: $LATEST_STABLE_DEVOPS"
+    git -C $TEMPDIR checkout tags/$LATEST_STABLE_DEVOPS || FATAL "Could not checkout latest tag"
+fi
+
+$TEMPDIR/installers/install_osm.sh --test $*
+
index 2f3ca93..4dfb011 100755 (executable)
@@ -32,6 +32,7 @@ OSM_load_config
 
 #Release TWO
 
+DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:ocata
 apt-get update
 apt-get -y install python-osm-ro
 
index 7000c8e..9cad24a 100755 (executable)
@@ -140,4 +140,4 @@ apt-get install -y \
 # Install libjuju
 apt-get install -y python3-pip python3-setuptools
 
-pip3 install juju
+pip3 install juju==0.6.1
index ae692f6..9cc1536 100755 (executable)
@@ -35,6 +35,9 @@ function cache() {
     # Wait for the container to get an IP address
     lxc exec $container -- bash -c "for i in {1..60}; do sleep 1; ping -c1 10.44.127.1 &> /dev/null && break; done"
 
+    # Wait for cloud-init to finish
+    lxc exec $container -- bash -c "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do sleep 1; done"
+
     lxc exec $container -- apt-get update -y
     lxc exec $container -- apt-get upgrade -y
     lxc exec $container -- apt-get install -y $PACKAGES $2
index b9dda53..1c2e7ed 100644 (file)
@@ -34,6 +34,7 @@ properties([
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'),
         booleanParam(defaultValue: false, description: '', name: 'DO_STAGE_4'),
+        booleanParam(defaultValue: false, description: '', name: 'SAVE_ARTIFACTS_OVERRIDE'),
     ])
 ])
 
@@ -50,15 +51,12 @@ node("${params.NODE}") {
     ci_helper = load "jenkins/ci-pipelines/ci_helper.groovy"
 
     def upstream_main_job = params.UPSTREAM_SUFFIX
-    def save_artifacts = false
 
     // upstream jobs always use merged artifacts
     upstream_main_job += '-merge'
     container_name_prefix = "osm-${tag_or_branch}"
     container_name = "${container_name_prefix}"
     if ( JOB_NAME.contains('merge') ) {
-        save_artifacts = true
-        println("merge job, saving artifacts")
         container_name += "-merge"
     }
     container_name += "-${BUILD_NUMBER}"
@@ -194,6 +192,7 @@ node("${params.NODE}") {
             junit '*.xml'
         }
 
+        stage_4_archive = false
         if ( params.DO_STAGE_4 ) {
             stage("stage_4") {
                 def downstream_params = [
@@ -201,13 +200,16 @@ node("${params.NODE}") {
                     string(name: 'NODE', value: NODE_NAME.split()[0]),
                 ]
                 stage_4_result = build job: "${params.DOWNSTREAM_STAGE_NAME}/${GERRIT_BRANCH}", parameters: downstream_params, propagate: false 
-               
                 currentBuild.result = stage_4_result.result
+
+                if ( stage_4_result.getResult().equals('SUCCESS') ) {
+                    stage_4_archive = true;
+                }
             }
         }
 
-        // save the artifacts of this build if this is a merge job
-        if ( save_artifacts ) {
+        // override to save the artifacts
+        if ( params.SAVE_ARTIFACTS_OVERRIDE || stage_4_archive ) {
             stage("Archive") {
                 sh "echo ${container_name} > build_version.txt"
                 archiveArtifacts artifacts: "build_version.txt", fingerprint: true
index ae18076..7eedc84 100755 (executable)
@@ -39,19 +39,26 @@ def config_changed():
 
     Verify that the charm has been configured
     """
-    status_set('maintenance', 'Verifying configuration data...')
-    (validated, output) = charms.sshproxy.verify_ssh_credentials()
-    if not validated:
-        status_set('blocked', 'Unable to verify SSH credentials: {}'.format(
-            output
-        ))
-        return
-    if all(k in cfg for k in ['mode']):
-        if cfg['mode'] in ['ping', 'pong']:
-            set_flag('pingpong.configured')
-            status_set('active', 'ready!')
+
+    try:
+        status_set('maintenance', 'Verifying configuration data...')
+
+        (validated, output) = charms.sshproxy.verify_ssh_credentials()
+        if not validated:
+            status_set('blocked', 'Unable to verify SSH credentials: {}'.format(
+                output
+            ))
             return
-    status_set('blocked', 'Waiting for configuration')
+
+        if all(k in cfg for k in ['mode']):
+            if cfg['mode'] in ['ping', 'pong']:
+                set_flag('pingpong.configured')
+                status_set('active', 'ready!')
+                return
+        status_set('blocked', 'Waiting for configuration')
+
+    except Exception as err:
+        status_set('blocked', 'Waiting for valid configuration ({})'.format(err))
 
 
 @when('config.changed')
index 2769fd0..5193801 100644 (file)
@@ -59,7 +59,7 @@ class TestClass(object):
         assert not osm.get_api().vim.delete(vim_name)
 
     @pytest.mark.vmware
-    @pytest.mark.smoke
+    #@pytest.mark.smoke
     def test_add_vim_account_vmware(self,osm,vmware,cleanup_test_add_vim_account):
         os_access = {}
         vim_name = 'helloworld-vmware'
@@ -81,7 +81,7 @@ class TestClass(object):
 
         assert not osm.get_api().vim.delete(vim_name)
 
-    @pytest.mark.smoke
+    #@pytest.mark.smoke
     def test_add_multiple_accounts(self,osm,cleanup_test_add_vim_account):
         os_access = {}
         vims = [ {'name': 'testvim1', 'vim-type': 'openstack'}, {'name': 'testvim2','vim-type': 'vmware'} ]
diff --git a/tools/gen-lxdimages.sh b/tools/gen-lxdimages.sh
new file mode 100755 (executable)
index 0000000..f3a639c
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+function usage() {
+    echo -e "usage: $0 [OPTIONS]"
+    echo -e "  OPTIONS"
+    echo -e "     -c <COMPONENT>:    the component whose lxd image has to be generated. Allowed values: RO, VCA, SOUI, MON"
+    echo -e "     -R <RELEASE>:      push images to specific RELEASE folder"
+}
+
+GEN_ALL="y"
+GEN_RO=""
+GEN_VCA=""
+GEN_SOUI=""
+GEN_MON=""
+RELEASE="ReleaseTHREE"
+
+while getopts ":h" o; do
+    case "${o}" in
+        h)
+            usage
+            exit 0
+            ;;
+        R)
+            RELEASE="${OPTARG}"
+            ;;
+        c)
+            [ "${OPTARG}" == "RO" ] && GEN_ALL="" && GEN_RO="y" && continue
+            [ "${OPTARG}" == "VCA" ] && GEN_ALL="" && GEN_VCA="y" && continue
+            [ "${OPTARG}" == "SOUI" ] && GEN_ALL="" && GEN_SOUI="y" && continue
+            [ "${OPTARG}" == "MON" ] && GEN_ALL="" && GEN_MON="y" && continue
+            echo -e "Invalid option: '--$OPTARG'\n" >&2
+            usage && exit 1
+            ;;
+        *)
+            usage && exit 1
+            ;;
+    esac
+done
+
+[ "$GEN_ALL" == "y" ] && GEN_RO="y" && GEN_VCA="y" && GEN_SOUI="y" && GEN_MON="y"
+
+echo "Stopping containers"
+lxc stop RO
+lxc stop VCA
+lxc stop SO-ub
+#lxc stop MON
+
+echo "Saving containers as images in local lxd server"
+OSM_RO_IMAGE="osm-ro"
+OSM_VCA_IMAGE="osm-vca"
+OSM_SOUI_IMAGE="osm-soui"
+OSM_MON_IMAGE="osm-mon"
+
+[ -n "$GEN_RO" ] && lxc publish --public RO --alias ${OSM_RO_IMAGE}
+[ -n "$GEN_VCA" ] && lxc publish --public VCA --alias ${OSM_VCA_IMAGE}
+[ -n "$GEN_SOUI" ] && lxc publish --public SO-ub --alias ${OSM_SOUI_IMAGE}
+#[ -n "$GEN_MON" ] && lxc publish --public MON --alias ${OSM_MON_IMAGE}
+#lxc image list
+
+#echo "Copying images to a remote lxd server"
+#[ -n "$GEN_RO" ] && lxc image copy ${OSM_RO_IMAGE} remote:
+#[ -n "$GEN_VCA" ] && lxc image copy ${OSM_VCA_IMAGE} remote:
+#[ -n "$GEN_SOUI" ] && lxc image copy ${OSM_SOUI_IMAGE} remote:
+#[ -n "$GEN_MON" ] && lxc image copy ${OSM_MON_IMAGE} remote:
+
+echo "Exporting images as targz"
+mkdir -p "${RELEASE}"
+#trap 'rm -rf "$RELEASE"' EXIT
+
+[ -n "$GEN_RO" ] && lxc image export "${OSM_RO_IMAGE}" "${RELEASE}"/"${OSM_RO_IMAGE}"
+[ -n "$GEN_VCA" ] && lxc image export "${OSM_VCA_IMAGE}" "${RELEASE}"/"${OSM_VCA_IMAGE}"
+[ -n "$GEN_SOUI" ] && lxc image export "${OSM_SOUI_IMAGE}" "${RELEASE}"/"${OSM_SOUI_IMAGE}"
+#[ -n "$GEN_MON" ] && lxc image export "${OSM_MON_IMAGE}" "${RELEASE}"/"${OSM_MON_IMAGE}"
+
+echo "Pushing images to ETSI FTP server"
+RSYNC_USER_HOST=osmusers@osm-download.etsi.org
+RSYNC_OPTIONS="--delete --progress"
+rsync -avR "$RSYNC_OPTIONS" "$RELEASE" rsync://$RSYNC_USER_HOST/repos/osm/lxd
+
+
index b1e768f..c7e7bc7 100755 (executable)
@@ -113,7 +113,9 @@ mkdir -p $BASE_DIR/dists
 
 cp -R $BUILD_NUMBER/dists/$IN_REPO $BASE_DIR/dists/$OUT_REPO
 cp -R $BUILD_NUMBER/pool $BASE_DIR/
-[ -d "$BUILD_NUMBER/changelog" ] && cp -R $BUILD_NUMBER/changelog $BASE_DIR/
+
+echo "copy changelog from $BUILD_NUMBER/changelog to $BASE_DIR/"
+cp -R $BUILD_NUMBER/changelog $BASE_DIR/
 
 cd $BASE_DIR
 
index 7960226..8aa2886 100755 (executable)
@@ -9,7 +9,7 @@ if [ $# -ge 2 ]; then
     BRANCH=$2
 fi
 
-modules="juju-charms devops descriptor-packages openvim RO SO UI osmclient"
+modules="juju-charms devops descriptor-packages openvim RO SO UI osmclient IM N2VC MON vim-emu"
 list=""
 for i in $modules; do
     if [ "$1" == "$i" -o "$1" == "all" ]; then