summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xxci/config/env-vars1
-rw-r--r--xci/file/aio/configure-opnfvhost.yml4
-rw-r--r--xci/file/setup-openstack.yml2
-rw-r--r--xci/opnfv-scenario-requirements.yml6
-rw-r--r--xci/playbooks/bootstrap-scenarios.yml5
-rw-r--r--xci/playbooks/configure-opnfvhost.yml8
-rwxr-xr-xxci/scripts/vm/start-new-vm.sh44
-rw-r--r--xci/var/opnfv.yml2
-rwxr-xr-xxci/xci-deploy.sh2
9 files changed, 46 insertions, 28 deletions
diff --git a/xci/config/env-vars b/xci/config/env-vars
index c399707b..a7d8696f 100755
--- a/xci/config/env-vars
+++ b/xci/config/env-vars
@@ -19,3 +19,4 @@ export XCI_ANSIBLE_PIP_VERSION=2.3.2.0
export ANSIBLE_HOST_KEY_CHECKING=False
# subject of the certificate
export XCI_SSL_SUBJECT=${XCI_SSL_SUBJECT:-"/C=US/ST=California/L=San Francisco/O=IT/CN=xci.releng.opnfv.org"}
+export OPNFV_SCENARIO=${OPNFV_SCENARIO:-"os-nosdn-nofeature"}
diff --git a/xci/file/aio/configure-opnfvhost.yml b/xci/file/aio/configure-opnfvhost.yml
index f24f470c..76a36196 100644
--- a/xci/file/aio/configure-opnfvhost.yml
+++ b/xci/file/aio/configure-opnfvhost.yml
@@ -18,11 +18,11 @@
command: "/bin/bash ./scripts/bootstrap-ansible.sh"
args:
chdir: "{{OPENSTACK_OSA_PATH}}"
- - name: Disable AIO tempest
+ - name: Configure AIO tempest
lineinfile:
path: "{{ OPENSTACK_OSA_PATH }}/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2"
regexp: "^{{ item }}.*"
- line: "{{ item }}: false"
+ line: "{{ item }}: {{ RUN_TEMPEST | bool }}"
state: present
with_items:
- "tempest_install"
diff --git a/xci/file/setup-openstack.yml b/xci/file/setup-openstack.yml
index 866a54f8..5d20adec 100644
--- a/xci/file/setup-openstack.yml
+++ b/xci/file/setup-openstack.yml
@@ -22,3 +22,5 @@
- include: os-horizon-install.yml
- include: os-swift-install.yml
- include: os-ironic-install.yml
+- include: os-tempest-install.yml
+ when: (tempest_install | default(False)) | bool or (tempest_run | default(False)) | bool
diff --git a/xci/opnfv-scenario-requirements.yml b/xci/opnfv-scenario-requirements.yml
index ee9b2baf..cde6467d 100644
--- a/xci/opnfv-scenario-requirements.yml
+++ b/xci/opnfv-scenario-requirements.yml
@@ -16,3 +16,9 @@
src: https://gerrit.opnfv.org/gerrit/sfc
version: master
role: scenarios/os-odl-sfc/role/os-odl-sfc
+- scenario: os-nosdn-ovs
+ scm: git
+ src: https://git.opnfv.org/releng-xci
+ version: master
+ role: xci/scenarios/os-nosdn-ovs/role/os-nosdn-ovs
+
diff --git a/xci/playbooks/bootstrap-scenarios.yml b/xci/playbooks/bootstrap-scenarios.yml
index e7bd7dc9..da5baf0f 100644
--- a/xci/playbooks/bootstrap-scenarios.yml
+++ b/xci/playbooks/bootstrap-scenarios.yml
@@ -8,3 +8,8 @@
# include_role:
# name: "foobar"
# when: OPNFV_SCENARIO == "foobar"
+
+- name: Prepare everything to run the os-nosdn-ovs scenario
+ include_role:
+ name: "os-nosdn-ovs"
+ when: OPNFV_SCENARIO == 'os-nosdn-ovs'
diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml
index 12fb3a0f..fdf21786 100644
--- a/xci/playbooks/configure-opnfvhost.yml
+++ b/xci/playbooks/configure-opnfvhost.yml
@@ -79,6 +79,14 @@
shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}"
- name: copy cinder.yml
shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d"
+ - name: Configure AIO tempest
+ lineinfile:
+ path: "{{ OPENSTACK_OSA_ETC_PATH }}/user_variables.yml"
+ line: "{{ item }}: {{ RUN_TEMPEST | bool }}"
+ state: present
+ with_items:
+ - "tempest_install"
+ - "tempest_run"
- block:
- name: copy ceph.yml
shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/ceph.yml {{OPENSTACK_OSA_ETC_PATH}}/conf.d/"
diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh
index a6942746..1b5ab038 100755
--- a/xci/scripts/vm/start-new-vm.sh
+++ b/xci/scripts/vm/start-new-vm.sh
@@ -45,22 +45,6 @@ usage() {
"""
}
-wait_for_pkg_mgr() {
- local pkg_mgr=$1
- local _retries=30
- while [[ $_retries -gt 0 ]]; do
- if pgrep -a $pkg_mgr &> /dev/null; then
- echo "There is another $pkg_mgr process running... ($_retries retries left)"
- sleep 30
- (( _retries = _retries - 1 ))
- else
- return 0
- fi
- done
- echo "$pkg_mgr still running... Maybe stuck?"
- exit 1
-}
-
update_clean_vm_files() {
local opnfv_url="http://artifacts.opnfv.org/releng/xci/images"
local vm_cache=${XCI_CACHE_DIR}/clean_vm/images
@@ -127,22 +111,33 @@ if ! sudo -n "true"; then
echo "$(id -nu) ALL=(ALL) NOPASSWD: ALL"
exit 1
fi
+
+# Wait 30-120 seconds so we avoid running multiple instances of pkg manager. Of course
+# this will not work as it should if there is an external process running a package
+# manager instance. However, since this script is only being execute on CI nodes which
+# we have complete control it should be mostly fine.
+backoff_time=0
+while [[ ${backoff_time} -le 30 ]]; do
+ backoff_time=$(( $RANDOM % 120 ))
+done
+
case ${ID,,} in
*suse)
- wait_for_pkg_mgr zypper
- sudo zypper -q -n in virt-manager qemu-kvm qemu-tools libvirt-daemon docker libvirt-client libvirt-daemon-driver-qemu iptables ebtables dnsmasq
+ pkg_mgr_cmd="sudo zypper -q -n install virt-manager qemu-kvm qemu-tools libvirt-daemon docker libvirt-client libvirt-daemon-driver-qemu iptables ebtables dnsmasq"
;;
centos)
- wait_for_pkg_mgr yum
- sudo yum install -q -y epel-release
- sudo yum install -q -y in virt-manager qemu-kvm qemu-kvm-tools qemu-img libvirt-daemon-kvm docker iptables ebtables dnsmasq
+ pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in virt-manager qemu-kvm qemu-kvm-tools qemu-img libvirt-daemon-kvm docker iptables ebtables dnsmasq"
;;
ubuntu)
- wait_for_pkg_mgr apt-get
- sudo apt-get install -y -q=3 virt-manager qemu-kvm libvirt-bin qemu-utils docker.io docker iptables ebtables dnsmasq
+ pkg_mgr_cmd="sudo apt-get install -y -q=3 virt-manager qemu-kvm libvirt-bin qemu-utils docker.io docker iptables ebtables dnsmasq"
;;
esac
+if pgrep -fa "${pkg_mgr_cmd%*install*}" 2>&1; then
+ sleep ${backoff_time}
+fi
+eval ${pkg_mgr_cmd}
+
echo "Ensuring libvirt and docker services are running..."
sudo systemctl -q start libvirtd
sudo systemctl -q start docker
@@ -288,8 +283,7 @@ echo "Preparing test environment..."
# *_xci_vm hostname is invalid. Letst just use distro name
$vm_ssh ${VM_NAME} "sudo hostname ${VM_NAME/_xci*}"
# Start with good dns
-$vm_ssh ${VM_NAME} 'sudo bash -c "echo nameserver 8.8.8.8 > /etc/resolv.conf"'
-$vm_ssh ${VM_NAME} 'sudo bash -c "echo nameserver 8.8.4.4 >> /etc/resolv.conf"'
+$vm_ssh ${VM_NAME} 'sudo bash -c "echo nameserver 192.168.140.1 > /etc/resolv.conf"'
cat > ${BASE_PATH}/vm_hosts.txt <<EOF
127.0.0.1 localhost ${VM_NAME/_xci*}
::1 localhost ipv6-localhost ipv6-loopback
diff --git a/xci/var/opnfv.yml b/xci/var/opnfv.yml
index 7dd9b46c..5378d13e 100644
--- a/xci/var/opnfv.yml
+++ b/xci/var/opnfv.yml
@@ -33,6 +33,8 @@ OPNFV_SSH_HOST_KEYS_PATH: "{{ lookup('env', 'OPNFV_SSH_HOST_KEYS_PATH') }}"
XCI_EXTRA_VARS_PATH: "{{ lookup('env', 'XCI_EXTRA_VARS_PATH') }}"
XCI_SSL_SUBJECT: "{{ lookup('env', 'XCI_SSL_SUBJECT') }}"
XCI_CEPH_ENABLED: "{{ lookup('env', 'XCI_CEPH_ENABLED') }}"
+RUN_TEMPEST: "{{ lookup('env', 'RUN_TEMPEST') }}"
+OPNFV_SCENARIO: "{{ lookup('env','OPNFV_SCENARIO') }}"
# install docker on opnfv host only if we are running as part of CI
opnfv_required_packages:
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 20f3d95a..a7435e75 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -268,7 +268,7 @@ echo "Info: Setting up infrastructure"
echo "-----------------------------------------------------------------------"
echo "xci: running ansible playbook setup-infrastructure.yml"
ssh root@$OPNFV_HOST_IP "openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \
- $OPENSTACK_OSA_PATH/playbooks//setup-infrastructure.yml | tee setup-infrastructure.log"
+ $OPENSTACK_OSA_PATH/playbooks/setup-infrastructure.yml | tee setup-infrastructure.log"
scp root@$OPNFV_HOST_IP:~/setup-infrastructure.log $LOG_PATH/setup-infrastructure.log
echo "-----------------------------------------------------------------------"
# check the log to see if we have any error