Skip to content

Commit 7b03e16

Browse files
committed
Update security group test
Update this security group to enable VM testing because it doesn't apply with previous security groups.
1 parent cbac00e commit 7b03e16

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/roles/development_environment/files/pre_launch.bash

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,19 @@ if [ "$PING_TEST_VM" = "true" ]; then
111111
fi
112112

113113
# Create security groups
114-
${BASH_ALIASES[openstack]} security group rule list --protocol icmp --ingress -f json | grep -q '"IP Range": "0.0.0.0/0"' || \
115-
${BASH_ALIASES[openstack]} security group rule create --protocol icmp --ingress --icmp-type -1 $(${BASH_ALIASES[openstack]} security group list --project admin -f value -c ID)
116-
${BASH_ALIASES[openstack]} security group rule list --protocol tcp --ingress -f json | grep '"Port Range": "22:22"' || \
117-
${BASH_ALIASES[openstack]} security group rule create --protocol tcp --ingress --dst-port 22 $(${BASH_ALIASES[openstack]} security group list --project admin -f value -c ID)
114+
115+
${BASH_ALIASES[openstack]} security group show adoption-test || {
116+
${BASH_ALIASES[openstack]} security group create adoption-test
117+
${BASH_ALIASES[openstack]} security group rule create --protocol icmp --ingress --icmp-type -1 adoption-test
118+
${BASH_ALIASES[openstack]} security group rule create --protocol tcp --ingress --dst-port 22 adoption-test
119+
}
120+
121+
# Add security groups
122+
123+
${BASH_ALIASES[openstack]} server add security group test adoption-test || true
124+
if [ "$PING_TEST_VM" = "true" ]; then
125+
${BASH_ALIASES[openstack]} server add security group test-ping adoption-test || true
126+
fi
118127

119128
export FIP=192.168.122.20
120129
# check connectivity via FIP

0 commit comments

Comments
 (0)