diff options
-rw-r--r-- | components/congress/joid/install_congress_1.sh | 13 | ||||
-rw-r--r-- | components/congress/joid/install_congress_2.sh | 60 | ||||
-rw-r--r-- | components/congress/test-webapp/setup/install_congress_testserver_1.sh | 21 | ||||
-rw-r--r-- | components/congress/test-webapp/setup/install_congress_testserver_2.sh | 43 | ||||
-rw-r--r-- | tests/adhoc/dmz01-clean.sh | 34 | ||||
-rw-r--r-- | tests/adhoc/dmz01.sh | 133 |
6 files changed, 235 insertions, 69 deletions
diff --git a/components/congress/joid/install_congress_1.sh b/components/congress/joid/install_congress_1.sh index 7bf45af..8c15076 100644 --- a/components/congress/joid/install_congress_1.sh +++ b/components/congress/joid/install_congress_1.sh @@ -27,19 +27,20 @@ if [ $# -lt 1 ]; then return 2 fi -set -x +if [ $1 == "debug" ]; then set -x #echo on +fi -# Create the congress container +echo "Create the congress container" juju ssh ubuntu@$1 "sudo lxc-clone -o juju-trusty-lxc-template -n juju-trusty-congress; sudo lxc-start -n juju-trusty-congress -d; exit" -# Get the congress server address +echo "Get the congress server address" CONGRESS_HOST="" while [ "$CONGRESS_HOST" == "" ]; do sleep 5 CONGRESS_HOST=$(juju ssh ubuntu@$1 "sudo lxc-info --name juju-trusty-congress | grep IP" | awk "/ / { print \$2 }" | tr -d '\r') done -# Create the environment file and copy to the congress server +echo "Create the environment file and copy to the congress server" cat <<EOF >~/env.sh export CONGRESS_HOST=$CONGRESS_HOST export KEYSTONE_HOST=$(juju status --format=short | awk "/keystone\/0/ { print \$3 }") @@ -53,8 +54,8 @@ source ~/env.sh juju scp ~/admin-openrc.sh ubuntu@$CONGRESS_HOST:/home/ubuntu juju scp ~/env.sh ubuntu@$CONGRESS_HOST:/home/ubuntu -# Copy the install script to the congress server and execute +echo "Copy the install script to the congress server and execute" juju scp ~/git/copper/components/congress/joid/install_congress_2.sh ubuntu@$CONGRESS_HOST:/home/ubuntu ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@$CONGRESS_HOST "source ~/install_congress_2.sh; exit" -set +x +set +x #echo off diff --git a/components/congress/joid/install_congress_2.sh b/components/congress/joid/install_congress_2.sh index 5c9ebb9..d8b0968 100644 --- a/components/congress/joid/install_congress_2.sh +++ b/components/congress/joid/install_congress_2.sh @@ -29,39 +29,39 @@ openstack EOF source ~/env.sh -# Update package repos +echo "Update package repos" sudo apt-get update -# install pip +echo "install pip" sudo apt-get install python-pip -y -# install java +echo "install java" sudo apt-get install default-jre -y -# install other dependencies +echo "install other dependencies" sudo apt-get install apg git gcc python-dev libxml2 libxslt1-dev libzip-dev -y -# set mysql root user password and install mysql +echo "set mysql root user password and install mysql" export MYSQL_PASSWORD=$(/usr/bin/apg -n 1 -m 16 -c cl_seed) sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '$MYSQL_PASSWORD sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '$MYSQL_PASSWORD sudo -E apt-get -q -y install mysql-server python-mysqldb -# Clone congress +echo "Clone congress" mkdir ~/git cd ~/git git clone https://github.com/openstack/congress.git cd congress git checkout stable/liberty -# Install virtualenv +echo "Install virtualenv" sudo pip install virtualenv -# Create virtualenv +echo "Create virtualenv" virtualenv ~/git/congress source bin/activate -# Setup Congress +echo "Setup Congress" sudo mkdir -p /etc/congress sudo mkdir -p /etc/congress/snapshot sudo mkdir /var/log/congress @@ -69,23 +69,23 @@ sudo chown ubuntu /var/log/congress sudo cp etc/api-paste.ini /etc/congress sudo cp etc/policy.json /etc/congress -# install requirements.txt and tox dependencies (detected by errors during "tox -egenconfig") +echo "install requirements.txt and tox dependencies (detected by errors during 'tox -egenconfig')" sudo apt-get install libffi-dev -y sudo apt-get install openssl -y sudo apt-get install libssl-dev -y -# install dependencies of Congress +echo "install dependencies of Congress" cd ~/git/congress sudo pip install -r requirements.txt sudo pip install . -# install tox +echo "install tox" sudo pip install tox -# generate congress.conf.sample +echo "generate congress.conf.sample" sudo tox -egenconfig -# edit congress.conf.sample as needed +echo "edit congress.conf.sample as needed" sudo sed -i -- 's/#verbose = true/verbose = true/g' etc/congress.conf.sample sudo sed -i -- 's/#log_file = <None>/log_file = congress.log/g' etc/congress.conf.sample sudo sed -i -- 's/#log_dir = <None>/log_dir = \/var\/log\/congress/g' etc/congress.conf.sample @@ -101,20 +101,20 @@ sudo sed -i -- 's/#admin_user = <None>/admin_user = congress/g' etc/congress.con sudo sed -i -- 's/#admin_password = <None>/admin_password = congress/g' etc/congress.conf.sample sudo sed -i -- 's/#connection = <None>/connection = mysql:\/\/ubuntu:'$MYSQL_PASSWORD'@localhost:3306\/congress/g' etc/congress.conf.sample -# copy congress.conf.sample to /etc/congress +echo "copy congress.conf.sample to /etc/congress" sudo cp etc/congress.conf.sample /etc/congress/congress.conf -# create congress database +echo "create congress database" sudo mysql --user=root --password=$MYSQL_PASSWORD -e "CREATE DATABASE congress; GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu@localhost' IDENTIFIED BY '"$MYSQL_PASSWORD"'; GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"'; exit;" -# install congress-db-manage dependencies (detected by errors) +echo "install congress-db-manage dependencies (detected by errors)" sudo apt-get build-dep python-mysqldb -y pip install MySQL-python -# create database schema +echo "create database schema" congress-db-manage --config-file /etc/congress/congress.conf upgrade head -# Install and test OpenStack client +echo "Install and test OpenStack client" cd ~/git git clone https://github.com/openstack/python-openstackclient.git cd python-openstackclient @@ -123,7 +123,7 @@ sudo pip install -r requirements.txt sudo pip install . openstack service list -# Install and test Congress client +echo "Install and test Congress client" cd ~/git git clone https://github.com/openstack/python-congressclient.git cd python-congressclient @@ -132,7 +132,7 @@ sudo pip install -r requirements.txt sudo pip install . openstack congress driver list -# Install and test Keystone client +echo "Install and test Keystone client" cd ~/git git clone https://github.com/openstack/python-keystoneclient.git cd python-keystoneclient @@ -140,7 +140,7 @@ git checkout stable/liberty sudo pip install -r requirements.txt sudo pip install . -# setup Congress user. TODO: needs update in http://congress.readthedocs.org/en/latest/readme.html#installing-congress +echo "setup Congress user. TODO: needs update in http://congress.readthedocs.org/en/latest/readme.html#installing-congress" pip install cliff --upgrade export ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") export SERVICE_TENANT=$(openstack project list | awk "/ admin / { print \$2 }") @@ -148,25 +148,25 @@ openstack user create --password congress --project admin --email "congress@exam export CONGRESS_USER=$(openstack user list | awk "/ congress / { print \$2 }") openstack role add --user $CONGRESS_USER --project $SERVICE_TENANT $ADMIN_ROLE -# Create Congress service +echo "Create Congress service" openstack service create congress --type "policy" --description "Congress Service" export CONGRESS_SERVICE=$(openstack service list | awk "/ congress / { print \$2 }") -# Create Congress endpoint +echo "Create Congress endpoint" openstack endpoint create $CONGRESS_SERVICE \ --region $OS_REGION_NAME \ --publicurl http://$CONGRESS_HOST:1789/ \ --adminurl http://$CONGRESS_HOST:1789/ \ --internalurl http://$CONGRESS_HOST:1789/ -# Start the Congress service in the background +echo "Start the Congress service in the background" cd ~/git/congress sudo bin/congress-server & -# disown the process (so it keeps running if you get disconnected) +echo "disown the process (so it keeps running if you get disconnected)" disown -h %1 -# Create data sources +echo "Create data sources" # To remove datasources: openstack congress datasource delete <name> # Insert a delay here, as nova datasource seems to fail to get setup (server not ready?) sleep 10 @@ -201,8 +201,8 @@ openstack congress datasource create keystone "keystone" \ --config password=$OS_PASSWORD \ --config auth_url=http://$KEYSTONE_HOST:5000/v2.0 -# Run Congress Tempest Tests +echo "Run Congress Tempest Tests" cd ~/git/congress # tox -epy27 -set +x -return + +set +x #echo off diff --git a/components/congress/test-webapp/setup/install_congress_testserver_1.sh b/components/congress/test-webapp/setup/install_congress_testserver_1.sh index 9342bc7..2c65464 100644 --- a/components/congress/test-webapp/setup/install_congress_testserver_1.sh +++ b/components/congress/test-webapp/setup/install_congress_testserver_1.sh @@ -28,22 +28,33 @@ # Create and Activate the Container # Earlier versions of the JOID installer installed lxc and created local templates # but now we have to get the ubuntu template from the controller -set -x +if [ $# -lt 2 ]; then + echo 1>&2 "$0: arguments required <controller_hostname> <user>" + return 2 +fi + +if [ $1 == "debug" ]; then set -x #echo on +fi + +echo "Install prerequisites" sudo apt-get install -y lxc +echo "Copy lxc-ubuntu container from the controller" juju scp ubuntu@$1:/usr/share/lxc/templates/lxc-ubuntu ~/lxc-ubuntu sudo cp ~/lxc-ubuntu /usr/share/lxc/templates/lxc-ubuntu +echo "Create the trusty-copper container" sudo lxc-create -n trusty-copper -t /usr/share/lxc/templates/lxc-ubuntu -l DEBUG -- -b $2 ~/$2 +echo "Start trusty-copper" sudo lxc-start -n trusty-copper -d if (($? > 0)); then echo Error starting trusty-copper lxc container return fi -# Get the CONGRESS_HOST value from env.sh +echo "Get the CONGRESS_HOST value from env.sh" source ~/env.sh -# Get the copper server address +echo "Get trusty-copper address" sleep 5 export COPPER_HOST="" while [ "$COPPER_HOST" == "" ]; do @@ -52,7 +63,7 @@ while [ "$COPPER_HOST" == "" ]; do done echo COPPER_HOST = $COPPER_HOST -# Create the environment file +echo "Create the environment file" cat <<EOF >~/env.sh export COPPER_HOST=$COPPER_HOST export CONGRESS_HOST=$CONGRESS_HOST @@ -64,7 +75,7 @@ export NEUTRON_HOST=$(juju status --format=short | awk "/neutron-api\/0/ { print export NOVA_HOST=$(juju status --format=short | awk "/nova-cloud-controller\/0/ { print \$3 }") EOF -# Invoke install_congress_testserver_2.sh +echo "Invoke install_congress_testserver_2.sh on trusty-copper" ssh -t -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $2@$COPPER_HOST "source ~/git/copper/components/congress/test-webapp/setup/install_congress_testserver_2.sh; exit" set +x diff --git a/components/congress/test-webapp/setup/install_congress_testserver_2.sh b/components/congress/test-webapp/setup/install_congress_testserver_2.sh index 009ff5e..98fdcd2 100644 --- a/components/congress/test-webapp/setup/install_congress_testserver_2.sh +++ b/components/congress/test-webapp/setup/install_congress_testserver_2.sh @@ -22,27 +22,27 @@ # How to use: # $ source ~/git/copper/tests/setup/install_congress_testserver_1.sh -# Setup OpenStack environment variables per your OPNFV install +echo "Setup OpenStack environment variables per your OPNFV install" source ~/env.sh source ~/admin-openrc.sh <<EOF openstack EOF -# Update the base server +echo "Update the base server" set -x sudo apt-get update sudo apt-get -y upgrade -# Install pip +echo "Install pip" sudo apt-get install -y python-pip -# Install java +echo "Install java" sudo apt-get install -y default-jre -# Install other dependencies +echo "Install other dependencies" sudo apt-get install -y git gcc python-dev libxml2 libxslt1-dev libzip-dev php5-curl -# Install and test OpenStack client +echo "Install and test OpenStack client" mkdir ~/coppertest mkdir ~/coppertest/git cd ~/coppertest/git @@ -53,7 +53,7 @@ sudo pip install -r requirements.txt sudo pip install . openstack service list -# Install and test Congress client +echo "Install and test Congress client" cd ~/coppertest/git git clone https://github.com/openstack/python-congressclient.git cd python-congressclient @@ -62,7 +62,7 @@ sudo pip install -r requirements.txt sudo pip install . openstack congress driver list -# Install and test Glance client +echo "Install and test Glance client" cd ~/coppertest/git git clone https://github.com/openstack/python-glanceclient.git cd python-glanceclient @@ -71,7 +71,7 @@ sudo pip install -r requirements.txt sudo pip install . glance image-list -# Install and test Neutron client +echo "Install and test Neutron client" cd ~/coppertest/git git clone https://github.com/openstack/python-neutronclient.git cd python-neutronclient @@ -80,7 +80,7 @@ sudo pip install -r requirements.txt sudo pip install . neutron net-list -# Install and test Nova client +echo "Install and test Nova client" cd ~/coppertest/git git clone https://github.com/openstack/python-novaclient.git cd python-novaclient @@ -89,7 +89,7 @@ sudo pip install -r requirements.txt sudo pip install . nova hypervisor-list -# Install and test Keystone client +echo "Install and test Keystone client" cd ~/coppertest/git git clone https://github.com/openstack/python-keystoneclient.git cd python-keystoneclient @@ -97,37 +97,34 @@ git checkout stable/liberty sudo pip install -r requirements.txt sudo pip install . -# </code> +echo "Setup the Congress Test Webappp" -# === Setup the Congress Test Webapp === - -# <code> -# Clone Copper (if not already cloned in user home) +echo "Clone Copper" cd ~/coppertest/git git clone https://gerrit.opnfv.org/gerrit/copper -# Install Apache, PHP +echo "Install Apache, PHP" sudo apt-get install -y apache2 php5 libapache2-mod-php5 sudo /etc/init.d/apache2 restart -# Copy the Apache config +echo "Copy the Apache config" sudo cp ~/coppertest/git/copper/components/congress/test-webapp/www/ubuntu-apache2.conf /etc/apache2/apache2.conf -# Copy the webapp to the Apache root directory and fix permissions +echo "Copy the webapp to the Apache root directory and fix permissions" sudo cp -R ~/coppertest/git/copper/components/congress/test-webapp/www/html /var/www sudo chmod 755 /var/www/html -R -# Point copper.js to the trusty-copper server per your install +echo "Point copper.js to the trusty-copper server per your install" sudo sed -i -- "s/COPPER_HOST/$COPPER_HOST/g" /var/www/html/copper.js -# Point proxy.php to the Congress server per your install +echo "Point proxy.php to the Congress server per your install" sudo sed -i -- "s/CONGRESS_HOST/$CONGRESS_HOST/g" /var/www/html/proxy/index.php -# Make webapp log directory and set permissions +echo "Make webapp log directory and set permissions" mkdir ~/coppertest/logs chmod 777 ~/coppertest/logs -# Restart Apache +echo "Restart Apache" sudo service apache2 restart set +x diff --git a/tests/adhoc/dmz01-clean.sh b/tests/adhoc/dmz01-clean.sh index 5a6ca7e..c218ef2 100644 --- a/tests/adhoc/dmz01-clean.sh +++ b/tests/adhoc/dmz01-clean.sh @@ -24,58 +24,82 @@ # After test, cleanup with # $ source ~/git/copper/tests/adhoc/dmz01-clean.sh -set -x #echo on +if [ $1 == "debug" ]; then set -x #echo on +fi source ~/admin-openrc.sh <<EOF openstack EOF +echo "Get Congress policy 'test' ID" +test_policy_ID=$(openstack congress policy show test | awk "/ id / { print \$4 }") + +echo "Delete Congress policy 'test' if it exists" +if [ "$test_policy_ID" != "" ]; then + openstack congress policy delete $test_policy_ID + echo "Existing policy 'test' deleted" +fi + +echo "Delete cirros1 instance" instance=$(nova list | awk "/ cirros1 / { print \$2 }") if [ "$instance" != "" ]; then nova delete $instance fi +echo "Delete cirros2 instance" instance=$(nova list | awk "/ cirros2 / { print \$2 }") if [ "$instance" != "" ]; then nova delete $instance fi +echo "Delete 'dmz' security group" sg=$(neutron security-group-list | awk "/ dmz / { print \$2 }") - neutron security-group-delete $sg +echo "Get 'test_router' ID" router=$(neutron router-list | awk "/ test_router / { print \$2 }") +echo "Get internal port ID with subnet 10.0.0.1 on 'test_router'" test_internal_interface=$(neutron router-port-list $router | grep 10.0.0.1 | awk '{print $2}') +echo "If found, delete the port with subnet 10.0.0.1 on 'test_router'" if [ "$test_internal_interface" != "" ]; then neutron router-interface-delete $router port=$test_internal_interface fi -test_public_interface=$(neutron router-port-list $router | grep 191.168.10.2 | awk '{print $2}') +echo "Get public port ID with subnet 192.168.10.2 on 'test_router'" +test_public_interface=$(neutron router-port-list $router | grep 192.168.10.2 | awk '{print $2}') +echo "If found, delete the port with subnet 192.168.10.2 on 'test_router'" if [ "$test_public_interface" != "" ]; then neutron router-interface-delete $router port=$test_public_interface fi +echo "Delete the router internal interface" neutron router-interface-delete $router $test_internal_interface +echo "Clear the router gateway" neutron router-gateway-clear test_router +echo "Delete the router" neutron router-delete test_router +echo "Delete neutron port on subnet 10.0.0.1" port=$(neutron port-list | awk "/ 10.0.0.1 / { print \$2 }") - if [ "$port" != "" ]; then neutron port-delete $port fi +echo "Delete neutron port on subnet 10.0.0.2" port=$(neutron port-list | awk "/ 10.0.0.2 / { print \$2 }") - if [ "$port" != "" ]; then neutron port-delete $port fi +echo "Delete internal subnet" neutron subnet-delete test_internal +echo "Delete internal network" neutron net-delete test_internal +echo "Delete public subnet" neutron subnet-delete test_public +echo "Delete public network" neutron net-delete test_public set +x #echo off diff --git a/tests/adhoc/dmz01.sh b/tests/adhoc/dmz01.sh new file mode 100644 index 0000000..7ca2b9c --- /dev/null +++ b/tests/adhoc/dmz01.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# Copyright 2015-2016 AT&T Intellectual Property, Inc +# +# 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. +# + +# What this is: An OpenStack Congress policy test. Sets up and validates policy +# creation and execution for: +# 1) Identifying VMs connected to a DMZ (currently identified through a +# specifically-named security group) +# 2) Identifying VMs connected per (1), which are by policy not allowed to be +# (currently implemented through an image tag intended to identify images +# that are "authorized" i.e. tested and secure, to be DMZ-connected) +# +# Status: this is a work in progress, under test. Test (1) has been verified, +# Test (2) is still in development. +# +# How to use: +# Install test server per https://wiki.opnfv.org/copper/academy/congress/test +# # Create Congress policy and resources that exercise polity +# $ source ~/git/copper/tests/adhoc/dmz01.sh +# After test, cleanup +# $ source ~/git/copper/tests/adhoc/dmz01-clean.sh + +if [ $1 == "debug" ]; then set -x #echo on +fi + +source ~/admin-openrc.sh <<EOF +openstack +EOF + +echo "Delete Congress policy 'test' if it exists" +test_policy_ID=$(openstack congress policy show test | awk "/ id / { print \$4 }") + +if [ "$test_policy_ID" != "" ]; then +# TODO: report bug - should be able to delete by name + openstack congress policy delete $test_policy_ID + echo "Existing policy 'test' deleted" +fi + +echo "Create Congress policy 'test'" +openstack congress policy create test + +echo "Create dmz_server rule in policy 'test'" +openstack congress policy rule create test "dmz_server(x) :- nova:servers(id=x,status='ACTIVE'), neutronv2:ports(id, device_id, status='ACTIVE'), neutronv2:security_group_port_bindings(pid, sg), neutronv2:security_groups(sg,name='dmz')" --name dmz_server + +echo "Create image cirros1 with non-dmz image" +image=$(openstack image list | awk "/ cirros-0.3.3-x86_64 / { print \$2 }") +if [ "$image" == "" ]; then glance --os-image-api-version 1 image-create --name cirros-0.3.3-x86_64 --disk-format qcow2 --location http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img --container-format bare +fi + +echo "Create image cirros2 with dmz image" +image=$(openstack image list | awk "/ cirros-0.3.3-x86_64-dmz / { print \$2 }") +if [ "$image" == "" ]; then glance --os-image-api-version 1 image-create --name cirros-0.3.3-x86_64-dmz --disk-format qcow2 --location http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img --container-format bare +fi + +echo "Get image ID of cirros dmz image" +IMAGE_ID=$(glance image-list | awk "/ cirros-0.3.3-x86_64-dmz / { print \$2 }") + +echo "Add 'dmz' image tag to the cirros dmz image" +glance --os-image-api-version 2 image-tag-update $IMAGE_ID "dmz" + +echo "Create external network" +neutron net-create test_public --router:external=true --provider:network_type=flat --provider:physical_network=physnet1 + +echo "Create external subnet" +neutron subnet-create --disable-dhcp test_public 192.168.10.0/24 + +echo "Create internal network" +neutron net-create test_internal + +echo "Create internal subnet" +neutron subnet-create test_internal 10.0.0.0/24 --name test_internal --gateway 10.0.0.1 --enable-dhcp --allocation-pool start=10.0.0.2,end=10.0.0.254 --dns-nameserver 8.8.8.8 + +echo "Create router" +neutron router-create test_router + +echo "Create router gateway" +neutron router-gateway-set test_router test_public + +echo "Add router internal for internal network" +neutron router-interface-add test_router subnet=test_internal + +echo "Wait 30 seconds as the previous command interrupts the neutron-api for some time..." +# add a delay since the previous command takes the neutron-api offline for a while (?) +sleep 30 + +echo "Get the internal network ID" +test_internal_NET=$(neutron net-list | awk "/ test_internal / { print \$2 }") + +echo "Create a security group 'dmz'" +neutron security-group-create dmz + +echo "Create security group ingress rule for 'dmz'" +neutron security-group-rule-create --direction ingress dmz + +echo "Boot cirros1 with non-dmz image" +nova boot --flavor m1.tiny --image cirros-0.3.3-x86_64 --nic net-id=$test_internal_NET --security-groups dmz cirros1 + +echo "Boot cirros2 with non-dmz image" +nova boot --flavor m1.tiny --image cirros-0.3.3-x86_64-dmz --nic net-id=$test_internal_NET --security-groups dmz cirros2\ + +echo "Wait 30 seconds for Congress polling to occur at least once" +sleep 30 + +echo "Get cirros1 instance ID" +test_cirros1_ID=$(openstack server list | awk "/ cirros1 / { print \$2 }") + +echo "Get cirros2 instance ID" +test_cirros2_ID=$(openstack server list | awk "/ cirros2 / { print \$2 }") + +echo "Check for presence of cirros1 ID in Congress policy 'test' table 'dmz_server'" +dmz_cirros1=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros1_ID / { print \$2 }") + +echo "Check for presence of cirros1 ID in Congress policy 'test' table 'dmz_server'" +dmz_cirros2=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros2_ID / { print \$2 }") + +echo "Verify cirros1 and cirros2 IDs are in the Congress policy 'test' table 'dmz_server'" +if [ "$dmz_cirros1" == "$test_cirros1_ID" ] && [ "$dmz_cirros2" == "$test_cirros2_ID" ]; then echo "Test Success!" +else echo "Test Failed!" +fi + +set +x #echo off |