+class TestDeploySimpleCharm(TestDeploy):
+ description = "Deploy hackfest-4 hackfest_simplecharm example"
+
+ def __init__(self):
+ super().__init__()
+ self.test_name = "HACKFEST-SIMPLE"
+ self.descriptor_url = "https://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/packages/"
+ self.vnfd_filenames = ("hackfest_simplecharm_vnf.tar.gz",)
+ self.nsd_filename = "hackfest_simplecharm_ns.tar.gz"
+ self.uses_configuration = True
+ self.cmds = {'1': [''], '2': ['ls -lrt /home/ubuntu/first-touch', ]}
+ self.uss = {'1': "ubuntu", '2': "ubuntu"}
+ self.pss = {'1': "osm4u", '2': "osm4u"}
+
+
+class TestDeploySimpleCharm2(TestDeploySimpleCharm):
+ description = "Deploy hackfest-4 hackfest_simplecharm example changing naming to contain dots on ids and " \
+ "vnf-member-index"
+
+ def __init__(self):
+ super().__init__()
+ self.test_name = "HACKFEST-SIMPLE2-"
+ self.qforce = "?FORCE=True"
+ self.descriptor_edit = {
+ "vnfd0": {
+ "id": "hackfest.simplecharm.vnf"
+ },
+
+ "nsd": {
+ "id": "hackfest.simplecharm.ns",
+ "constituent-vnfd": {
+ "$[0]": {"vnfd-id-ref": "hackfest.simplecharm.vnf", "member-vnf-index": "$1"},
+ "$[1]": {"vnfd-id-ref": "hackfest.simplecharm.vnf", "member-vnf-index": "$2"},
+ },
+ "vld": {
+ "$[0]": {
+ "vnfd-connection-point-ref": {"$[0]": {"member-vnf-index-ref": "$1",
+ "vnfd-id-ref": "hackfest.simplecharm.vnf"},
+ "$[1]": {"member-vnf-index-ref": "$2",
+ "vnfd-id-ref": "hackfest.simplecharm.vnf"}},
+ },
+ "$[1]": {
+ "vnfd-connection-point-ref": {"$[0]": {"member-vnf-index-ref": "$1",
+ "vnfd-id-ref": "hackfest.simplecharm.vnf"},
+ "$[1]": {"member-vnf-index-ref": "$2",
+ "vnfd-id-ref": "hackfest.simplecharm.vnf"}},
+ },
+ }
+ }
+ }
+
+
+class TestDeployHackfest3Charmed2(TestDeployHackfest3Charmed):
+ description = "Load and deploy Hackfest 3charmed_ns example modified version of descriptors to have dots in " \
+ "ids and member-vnf-index"
+
+ def __init__(self):
+ super().__init__()
+ self.test_name = "HACKFEST3bis"
+ self.qforce = "?FORCE=True"
+ self.descriptor_edit = {
+ "vnfd0": {
+ "vdu": {
+ "$[0]": {
+ "interface": {"$[0]": {"external-connection-point-ref": "pdu-mgmt"}}
+ },
+ "$[1]": None
+ },
+ "vnf-configuration": None,
+ "connection-point": {
+ "$[0]": {
+ "id": "pdu-mgmt",
+ "name": "pdu-mgmt",
+ "short-name": "pdu-mgmt"
+ },
+ "$[1]": None
+ },
+ "mgmt-interface": {"cp": "pdu-mgmt"},
+ "description": "A vnf single vdu to be used as PDU",
+ "id": "vdu-as-pdu",
+ "internal-vld": {
+ "$[0]": {
+ "id": "pdu_internal",
+ "name": "pdu_internal",
+ "internal-connection-point": {"$[1]": None},
+ "short-name": "pdu_internal",
+ "type": "ELAN"
+ }
+ }
+ },
+
+ # Modify NSD accordingly
+ "nsd": {
+ "constituent-vnfd": {
+ "$[0]": {"vnfd-id-ref": "vdu-as-pdu"},
+ "$[1]": None,
+ },
+ "description": "A nsd to deploy the vnf to act as as PDU",
+ "id": "nsd-as-pdu",
+ "name": "nsd-as-pdu",
+ "short-name": "nsd-as-pdu",
+ "vld": {
+ "$[0]": {
+ "id": "mgmt_pdu",
+ "name": "mgmt_pdu",
+ "short-name": "mgmt_pdu",
+ "vnfd-connection-point-ref": {
+ "$[0]": {
+ "vnfd-connection-point-ref": "pdu-mgmt",
+ "vnfd-id-ref": "vdu-as-pdu",
+ },
+ "$[1]": None
+ },
+ "type": "ELAN"
+ },
+ "$[1]": None,
+ }
+ }
+ }
+
+