summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xci/deploy/deploy.sh3
-rwxr-xr-xcode/jasmine/configure.ac2
-rwxr-xr-xcode/jasmine/daisy4nfv-jasmine.spec.in (renamed from code/jasmine/jasmine.spec.in)4
-rw-r--r--deploy/environment.py3
-rw-r--r--deploy/scenario/ha_odl_nofeature_scenario.yaml50
-rw-r--r--deploy/scenario/no-ha_odl_nofeature_scenario.yaml46
-rw-r--r--deploy/scenario/scenario.yaml10
-rw-r--r--deploy/tempest.py12
-rw-r--r--deploy/utils.py4
-rw-r--r--requirements.txt2
-rw-r--r--test-requirements.txt2
-rw-r--r--tests/conftest.py17
-rw-r--r--tests/data/lab_conf/deploy_virtual1.yml31
-rw-r--r--tests/data/lab_conf/network_virtual1.yml69
-rw-r--r--tests/unit/test_get_conf.py66
15 files changed, 310 insertions, 11 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh
index a4f1e7a3..9360da85 100755
--- a/ci/deploy/deploy.sh
+++ b/ci/deploy/deploy.sh
@@ -64,7 +64,8 @@ DRY_RUN=0
IS_BARE=1
VM_MULTINODE=("computer01" "computer02" "controller02" "controller03" "controller01")
VALID_DEPLOY_SCENARIO=("os-nosdn-nofeature-noha" "os-nosdn-nofeature-ha" "os-odl_l3-nofeature-noha"
- "os-odl_l2-nofeature-noha" "os-odl_l3-nofeature-ha" "os-odl_l2-nofeature-ha")
+ "os-odl_l2-nofeature-noha" "os-odl_l3-nofeature-ha" "os-odl_l2-nofeature-ha"
+ "os-odl-nofeature-noha" "os-odl-nofeature-ha")
#
# END of variables to customize
diff --git a/code/jasmine/configure.ac b/code/jasmine/configure.ac
index 4ce1997b..e29b1092 100755
--- a/code/jasmine/configure.ac
+++ b/code/jasmine/configure.ac
@@ -4,7 +4,7 @@
# bootstrap / init
AC_PREREQ([2.61])
-AC_INIT([jasmine],
+AC_INIT([daisy4nfv-jasmine],
[1.2],
[hu.zhijiang@zte.com.cn])
diff --git a/code/jasmine/jasmine.spec.in b/code/jasmine/daisy4nfv-jasmine.spec.in
index 73172f31..d631b4e5 100755
--- a/code/jasmine/jasmine.spec.in
+++ b/code/jasmine/daisy4nfv-jasmine.spec.in
@@ -1,5 +1,5 @@
Summary: Just A Small Multicast engINE
-Name: jasmine
+Name: daisy4nfv-jasmine
Version: @version@
Release: 1%{?dist}
Vendor: ZTE
@@ -11,7 +11,7 @@ Source: %{name}-%{version}%{?gittarver}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
-jasmine is used to distribute files over UDP multicast for installers
+daisy4nfv-jasmine is used to distribute files over UDP multicast for installers
%prep
%setup -q -n %{name}-%{version}%{?gittarver}
diff --git a/deploy/environment.py b/deploy/environment.py
index 87c16937..dd9e0142 100644
--- a/deploy/environment.py
+++ b/deploy/environment.py
@@ -144,7 +144,7 @@ class BareMetalEnvironment(DaisyEnvironmentBase):
create_vm(template,
name=self.daisy_server_info['name'],
- disk_file=self.daisy_server_info['image'])
+ disks=[self.daisy_server_info['image']])
def reboot_nodes(self, boot_dev=None):
# TODO: add ipmi info into deploy.yml, or read from PDF
@@ -168,6 +168,7 @@ class BareMetalEnvironment(DaisyEnvironmentBase):
self.server.check_os_installation(len(self.deploy_struct['hosts']))
time.sleep(10)
self.server.check_openstack_installation(len(self.deploy_struct['hosts']))
+ self.server.post_deploy()
class VirtualEnvironment(DaisyEnvironmentBase):
diff --git a/deploy/scenario/ha_odl_nofeature_scenario.yaml b/deploy/scenario/ha_odl_nofeature_scenario.yaml
new file mode 100644
index 00000000..59e16c4f
--- /dev/null
+++ b/deploy/scenario/ha_odl_nofeature_scenario.yaml
@@ -0,0 +1,50 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+##############################################################################
+# deployment configuration meta-data
+deployment-scenario-metadata:
+ title: ODL-L3 HA deployment
+ version: 0.0.1
+ created: Jun 8 2017
+ comment:
+
+##############################################################################
+# Stack extentions are opnfv added value features
+stack-extensions:
+ - module: opendaylight
+ module-config:
+ - enable_l3_odl:
+ value: true
+
+##############################################################################
+# By editing the override-config sections below, you can override arbitrary
+# configuration name-space settings
+deploy-override-config:
+ hosts:
+ - name: 'controller01'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+ - name: 'controller02'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+ - name: 'controller03'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+ - name: 'computer01'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml'
+ - name: 'computer02'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml' \ No newline at end of file
diff --git a/deploy/scenario/no-ha_odl_nofeature_scenario.yaml b/deploy/scenario/no-ha_odl_nofeature_scenario.yaml
new file mode 100644
index 00000000..e91acc6f
--- /dev/null
+++ b/deploy/scenario/no-ha_odl_nofeature_scenario.yaml
@@ -0,0 +1,46 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+##############################################################################
+# deployment configuration meta-data
+deployment-scenario-metadata:
+ title: ODL-L3 NO-HA deployment
+ version: 0.0.1
+ created: Jun 8 2017
+ comment:
+
+##############################################################################
+# Stack extentions are opnfv added value features
+stack-extensions:
+ - module: opendaylight
+ module-config:
+ - enable_l3_odl:
+ value: true
+
+##############################################################################
+# By editing the override-config sections below, you can override arbitrary
+# configuration name-space settings
+deploy-override-config:
+ hosts:
+ - name: 'controller01'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+ - name: 'computer01'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml'
+ - name: 'computer02'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml'
+ - name: 'computer03'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml' \ No newline at end of file
diff --git a/deploy/scenario/scenario.yaml b/deploy/scenario/scenario.yaml
index 81862485..1b04549a 100644
--- a/deploy/scenario/scenario.yaml
+++ b/deploy/scenario/scenario.yaml
@@ -13,6 +13,8 @@
# controler: nosdn|odl|onos|ocl|...
# feaure: nofeature | [vlan]_[kvm]_[ovs]_[vlan]_....
# mode: ha|noha
+# NOTE: os-odl-nofeature-noha = os-odl_l3-nofeature-noha
+# os-odl-nofeature-ha = os-odl_l3-nofeature-ha
##############################################################################
os-nosdn-nofeature-ha:
@@ -31,4 +33,10 @@ os-odl_l2-nofeature-ha:
configfile: ha_odl-l2_nofeature_scenario.yaml
os-odl_l2-nofeature-noha:
- configfile: no-ha_odl-l2_nofeature_scenario.yaml \ No newline at end of file
+ configfile: no-ha_odl-l2_nofeature_scenario.yaml
+
+os-odl-nofeature-ha:
+ configfile: ha_odl_nofeature_scenario.yaml
+
+os-odl-nofeature-noha:
+ configfile: no-ha_odl_nofeature_scenario.yaml
diff --git a/deploy/tempest.py b/deploy/tempest.py
index 3c1a6c7d..b154e72d 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -103,10 +103,14 @@ def prepare_install():
protocol_type = None
enable_cinder_backend(cluster_id, service_name,
ceph_disk_name, protocol_type)
- if 'scenario' in conf and 'odl_l3' in conf['scenario']:
- enable_opendaylight(cluster_id, 'odl_l3')
- elif 'scenario' in conf and 'odl_l2' in conf['scenario']:
- enable_opendaylight(cluster_id, 'odl_l2')
+
+ if 'scenario' in conf:
+ if 'odl_l3' in conf['scenario'] or \
+ 'odl' in conf['scenario']:
+ enable_opendaylight(cluster_id, 'odl_l3')
+ elif 'odl_l2' in conf['scenario']:
+ enable_opendaylight(cluster_id, 'odl_l2')
+
if not isbare:
install_os_for_vm_step1(cluster_id)
else:
diff --git a/deploy/utils.py b/deploy/utils.py
index bb5535fc..55fbc53a 100644
--- a/deploy/utils.py
+++ b/deploy/utils.py
@@ -24,7 +24,9 @@ valid_scenario_list = ['os-nosdn-nofeature-noha',
'os-odl_l2-nofeature-noha',
'os-nosdn-nofeature-ha',
'os-odl_l3-nofeature-ha',
- 'os-odl_l2-nofeature-ha']
+ 'os-odl_l2-nofeature-ha',
+ 'os-odl-nofeature-noha',
+ 'os-odl-nofeature-ha']
def get_logger():
diff --git a/requirements.txt b/requirements.txt
index 2bdce8b3..99af97bb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,3 +4,5 @@ jsonschema
paramiko
pyyaml
scp
+oslo_config
+deepdiff
diff --git a/test-requirements.txt b/test-requirements.txt
index 71796168..e80bdb21 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -8,3 +8,5 @@ pytest-faker
pytest-mock
pyyaml
scp
+oslo_config
+deepdiff
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 00000000..6a8dd68f
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,17 @@
+##############################################################################
+# Copyright (c) 2016 ZTE Corp and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+from os import path
+
+import pytest
+
+
+@pytest.fixture(scope='session')
+def data_root():
+ return path.join(path.dirname(__file__), 'data')
diff --git a/tests/data/lab_conf/deploy_virtual1.yml b/tests/data/lab_conf/deploy_virtual1.yml
new file mode 100644
index 00000000..7fdfc3ba
--- /dev/null
+++ b/tests/data/lab_conf/deploy_virtual1.yml
@@ -0,0 +1,31 @@
+adapter: libvirt
+hosts:
+- name: 'controller01'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+- name: 'controller02'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+- name: 'controller03'
+ roles:
+ - 'CONTROLLER_LB'
+ template: 'templates/virtual_environment/vms/controller.xml'
+- name: 'computer01'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml'
+- name: 'computer02'
+ roles:
+ - 'COMPUTER'
+ template: 'templates/virtual_environment/vms/computer.xml'
+disks:
+ daisy: 50
+ controller: 110
+ compute: 110
+ ceph: 110
+daisy_passwd: 'r00tme'
+daisy_ip: '10.20.11.2'
+daisy_gateway: '10.20.11.1'
+ceph_disk_name: '/dev/sdb' \ No newline at end of file
diff --git a/tests/data/lab_conf/network_virtual1.yml b/tests/data/lab_conf/network_virtual1.yml
new file mode 100644
index 00000000..d0fc26bf
--- /dev/null
+++ b/tests/data/lab_conf/network_virtual1.yml
@@ -0,0 +1,69 @@
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+network-config-metadata:
+ title: 'zte-virtual1 network config'
+ version: '0.1'
+ created: 'Tue Apr 11 2017'
+ comment: 'five vm node deploy'
+networks:
+ - cidr: '10.20.11.0/24'
+ gateway: '10.20.11.1'
+ ip_ranges:
+ - start: '10.20.11.3'
+ end: '10.20.11.10'
+ name: 'MANAGEMENT'
+ - cidr: '10.20.11.0/24'
+ gateway: '10.20.11.1'
+ ip_ranges:
+ - start: '10.20.11.3'
+ end: '10.20.11.10'
+ name: 'STORAGE'
+ - cidr: '172.10.101.0/24'
+ gateway: '172.10.101.1'
+ ip_ranges:
+ - start: '172.10.101.2'
+ end: '172.10.101.20'
+ name: 'EXTERNAL'
+ network_name: 'admin_external'
+ mapping: 'physnet1'
+ - cidr: '10.20.11.0/24'
+ gateway: '10.20.11.1'
+ ip_ranges:
+ - start: '10.20.11.3'
+ end: '10.20.11.10'
+ name: 'PUBLICAPI'
+ - cidr: '10.20.11.0/24'
+ gateway: '10.20.11.1'
+ ip_ranges:
+ - start: '10.20.11.3'
+ end: '10.20.11.10'
+ name: 'TENANT'
+ - cidr: '100.20.11.0/24'
+ gateway: '100.20.11.1'
+ ip_ranges:
+ - start: '100.20.11.3'
+ end: '100.20.11.10'
+ name: 'HEARTBEAT'
+interfaces:
+ - name: 'EXTERNAL'
+ interface: 'ens8'
+ - name: 'MANAGEMENT'
+ interface: 'ens3'
+ - name: 'PUBLICAPI'
+ interface: 'ens3'
+ - name: 'STORAGE'
+ interface: 'ens3'
+ - name: 'TENANT'
+ interface: 'ens3'
+ - name: 'HEARTBEAT'
+ interface: 'ens9'
+internal_vip: '10.20.11.11'
+public_vip: '10.20.11.11' \ No newline at end of file
diff --git a/tests/unit/test_get_conf.py b/tests/unit/test_get_conf.py
new file mode 100644
index 00000000..f882d9d2
--- /dev/null
+++ b/tests/unit/test_get_conf.py
@@ -0,0 +1,66 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Corp and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import os
+import pytest
+from deepdiff import DeepDiff
+
+from deploy.get_conf import (
+ get_yml_para,
+ config
+)
+
+
+@pytest.fixture(scope="session")
+def deploy_file(data_root):
+ return os.path.join(data_root, 'lab_conf', 'deploy_virtual1.yml')
+
+
+@pytest.fixture(scope="session")
+def network_file(data_root):
+ return os.path.join(data_root, 'lab_conf', 'network_virtual1.yml')
+
+
+def test_get_yml_para(deploy_file):
+ assert get_yml_para(deploy_file) == (50, 110, 110, 'r00tme', '10.20.11.2', '10.20.11.1', 5)
+
+
+def test_config(deploy_file, network_file):
+ result = config(deploy_file, network_file)
+ expect = ({'ens8': [{'ip': '', 'name': 'EXTERNAL'}],
+ 'ens3': [{'ip': '', 'name': 'MANAGEMENT'},
+ {'ip': '', 'name': 'PUBLICAPI'},
+ {'ip': '', 'name': 'STORAGE'},
+ {'ip': '', 'name': 'physnet1'}],
+ 'ens9': [{'ip': '', 'name': 'HEARTBEAT'}]},
+ ['computer01', 'computer02', 'controller01', 'controller02', 'controller03'],
+ {'MANAGEMENT': {'cidr': '10.20.11.0/24', 'gateway': '10.20.11.1',
+ 'ip_ranges': [{'start': '10.20.11.3',
+ 'end': '10.20.11.10'}]},
+ 'STORAGE': {'cidr': '10.20.11.0/24', 'gateway': '10.20.11.1',
+ 'ip_ranges': [{'start': '10.20.11.3',
+ 'end': '10.20.11.10'}]},
+ 'EXTERNAL': {'cidr': '172.10.101.0/24', 'gateway': '172.10.101.1',
+ 'ip_ranges': [{'start': '172.10.101.2',
+ 'end': '172.10.101.20'}],
+ 'network_name': 'admin_external',
+ 'mapping': 'physnet1'},
+ 'PUBLICAPI': {'cidr': '10.20.11.0/24', 'gateway': '10.20.11.1',
+ 'ip_ranges': [{'start': '10.20.11.3',
+ 'end': '10.20.11.10'}]},
+ 'physnet1': {'cidr': '10.20.11.0/24', 'gateway': '10.20.11.1',
+ 'ip_ranges': [{'start': '10.20.11.3',
+ 'end': '10.20.11.10'}]},
+ 'HEARTBEAT': {'cidr': '100.20.11.0/24', 'gateway': '100.20.11.1',
+ 'ip_ranges': [{'start': '100.20.11.3',
+ 'end': '100.20.11.10'}]}},
+ '10.20.11.11', '/dev/sdb',
+ {'controller01': [], 'controller02': [], 'controller03': [],
+ 'computer01': [], 'computer02': []})
+ assert DeepDiff(result, expect, ignore_order=True) == {}