Update neutron to 9.0.0~b3
[openstack-build/neutron-build.git] / tests / runtests.sh
index a15a6e40ca3ac4401013bfdfcfef2dc419c3e27f..91f3d12093f163df1520a9b4ee2a285092f72ae9 100755 (executable)
@@ -13,7 +13,13 @@ AUTH="--os-auth-url http://127.0.0.1:35357 --os-token $TOKEN --os-endpoint http:
 NEUTRON_AUTH="--os-username neutron --os-password neutron --os-tenant-name neutron --os-auth-url http://127.0.0.1:35357/v2.0"
 CORE_PLUGIN="neutron.plugins.ml2.plugin.Ml2Plugin"
 
-if [[ $PLATFORM =~ Ubuntu ]]; then UBUNTU=true; fi
+if [[ $PLATFORM =~ Ubuntu ]]
+then
+   UBUNTU=true
+else
+   setenforce 0
+fi
+
 if [ -z $PACKAGE ]; then echo "Package for testing is not specified"; exit 1; fi
 echo "127.0.10.1 $(hostname)" >> /etc/hosts
 
@@ -23,7 +29,7 @@ install_packages() {
     then
         echo "mysql-server mysql-server/root_password select $MYSQL_PASS" | debconf-set-selections
         echo "mysql-server mysql-server/root_password_again select $MYSQL_PASS" | debconf-set-selections
-        apt-get install -y --force-yes rabbitmq-server mysql-server mysql-client-core-5.5 python-mysqldb keystone
+        DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes rabbitmq-server mysql-server mysql-client-core-5.5 python-mysqldb keystone
     else
         #yum install -y openstack-keystone rabbitmq-server mysql-server MySQL-client python-oslo-utils
         yum install -y openstack-keystone rabbitmq-server python-oslo-utils
@@ -40,7 +46,7 @@ install_packages() {
 install_neutron_server () {
     if $UBUNTU
     then
-        apt-get install -y --force-yes neutron-server
+        DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes neutron-server
     else
         yum install -y openstack-neutron openstack-neutron-ml2
     fi
@@ -80,10 +86,6 @@ setup_database() {
 
 setup_keystone() {
     #Setup Keystone
-    if ! $UBUNTU
-    then
-        cp /usr/share/keystone/keystone-dist-paste.ini /etc/keystone/keystone-paste.ini
-    fi
     cat > /etc/keystone/keystone.conf << EOF
 [DEFAULT]
 admin_token=$TOKEN
@@ -93,6 +95,7 @@ connection=mysql://keystone:keystone@localhost/keystone
 provider=keystone.token.providers.uuid.Provider
 EOF
     keystone-manage db_sync
+    keystone-manage bootstrap --bootstrap-password $TOKEN
     chown -R keystone:keystone /var/log/keystone/
     if $UBUNTU
     then
@@ -104,7 +107,6 @@ EOF
     #Setup Neutron credentials
     keystone $AUTH user-create --name neutron --pass neutron
     keystone $AUTH tenant-create --name neutron
-    keystone $AUTH role-create --name=admin
     keystone $AUTH user-role-add --user neutron --role admin --tenant neutron
     NEUTRON_SERVICE=`keystone $AUTH service-create --name=neutron --type=network --description="Neutron Networking Service" | grep id | awk -F '|' '{print $3}' | tr -d ' '`
     keystone $AUTH endpoint-create --region RegionOne --service-id=$NEUTRON_SERVICE --publicurl=http://localhost:9696 --internalurl=http://localhost:9696 --adminurl=http://localhost:9696
@@ -204,21 +206,22 @@ check_neutron_openvswitch () {
     # Workaround for bug #1371184
     if ! $UBUNTU
     then
-        chown root:neutron /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
+        chown root:neutron /etc/neutron/plugins/ml2/openvswitch_agent.ini
     fi
 
     if ! $SERVICE_STARTED ; then
         if $UBUNTU; then
             restart_service openvswitch-switch
+            restart_service neutron-openvswitch-agent
         else
             restart_service openvswitch
+            restart_service neutron-openvswitch-agent
         fi
-        restart_service neutron-openvswitch-agent
         SERVICE_STARTED=true
     fi
 
     sleep 10
-    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Open vSwitch agent" | awk -F "|" '{print $5}' | tr -d " ")
+    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Open vSwitch agent" | awk -F "|" '{print $6}' | tr -d " ")
     if [ "$STATUS" != ":-)" ]; then echo "OVS agent check failed"; FAILURE=true; fi
 }
 
@@ -229,7 +232,7 @@ check_neutron_l3_agent () {
     fi
     #This sleep here and in other functions is intended to let the agent add information to the queue
     sleep 10
-    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "L3 agent" | awk -F "|" '{print $5}' | tr -d " ")
+    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "L3 agent" | awk -F "|" '{print $6}' | tr -d " ")
     if [ "$STATUS" != ":-)" ]; then echo "L3 agent check failed"; FAILURE=true; fi
 }
 
@@ -239,7 +242,7 @@ check_neutron_dhcp_agent () {
         SERVICE_STARTED=true
     fi
     sleep 10
-    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "DHCP agent" | awk -F "|" '{print $5}' | tr -d " ")
+    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "DHCP agent" | awk -F "|" '{print $6}' | tr -d " ")
     if [ "$STATUS" != ":-)" ]; then echo "DHCP agent check failed"; FAILURE=true; fi
 }
 
@@ -249,7 +252,7 @@ check_neutron_metadata_agent () {
         SERVICE_STARTED=true
     fi
     sleep 10
-    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Metadata agent" | awk -F "|" '{print $5}' | tr -d " ")
+    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Metadata agent" | awk -F "|" '{print $6}' | tr -d " ")
     if [ "$STATUS" != ":-)" ]; then echo "Metadata agent check failed"; FAILURE=true; fi
 }
 
@@ -259,7 +262,7 @@ check_neutron_metering_agent () {
         SERVICE_STARTED=true
     fi
     sleep 10
-    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Metering agent" | awk -F "|" '{print $5}' | tr -d " ")
+    STATUS=$(neutron $NEUTRON_AUTH agent-list | grep "Metering agent" | awk -F "|" '{print $6}' | tr -d " ")
     if [ "$STATUS" != ":-)" ]; then echo "Metering agent check failed"; FAILURE=true; fi
 }
 
@@ -315,7 +318,7 @@ case $PACKAGE in
     try check_neutron_server
     check_error
   ;;
-  openstack-neutron-openvswitch|neutron-plugin-openvswitch-agent)
+  openstack-neutron-openvswitch|neutron-openvswitch-agent)
     install_packages
     install_neutron_server
     setup_database
@@ -363,7 +366,7 @@ case $PACKAGE in
     try check_neutron_metadata_agent
     check_error
   ;;
-  openstack-neutron-metering-agent|neutron-plugin-metering-agent)
+  openstack-neutron-metering-agent|neutron-metering-agent)
     install_neutron_server
     install_packages
     setup_database