diff --git a/snap-overlay/data/mysql.tar.xz b/snap-overlay/data/mysql.tar.xz index e9ad1c8..9552131 100644 Binary files a/snap-overlay/data/mysql.tar.xz and b/snap-overlay/data/mysql.tar.xz differ diff --git a/snap/hooks/configure b/snap/hooks/configure index 55c0b79..88d91f0 100755 --- a/snap/hooks/configure +++ b/snap/hooks/configure @@ -23,6 +23,12 @@ done # Grant nova user access to cell0 echo "GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'10.20.20.1' IDENTIFIED BY 'nova';" | mysql-start-client -u root +# Endpoints from localhost -> 10.20.20.1 +# TODO Rebuild database so that these are already set to 10.20.20.1, +# after lp:1824176 is addressed, and the process of building a new +# mysql.tar.xz is less fraught. +openstack endpoint list | grep localhost | while read line; do openstack endpoint set `echo $line | cut -d" " -f2` --url `echo $line | cut -d" " -f14 | sed 's/localhost/10.20.20.1/'`; done + # RabbitMQ echo "Configuring RabbitMQ" # Rabbitmq isn't always started when we run this. Wait for it to start. diff --git a/tests/basic-test.sh b/tests/basic-test.sh index 72225af..c96607a 100755 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -20,8 +20,23 @@ multipass copy-files microstack_rocky_amd64.snap $MACHINE: multipass exec $MACHINE -- \ sudo snap install --classic --dangerous microstack*.snap -# Run microstack.launch and wait for it to complete. +# Run microstack.launch multipass exec $MACHINE -- /snap/bin/microstack.launch breakfast + +# Verify that endpoints are setup correctly +# List of endpoints should contain 10.20.20.1 +if ! multipass exec $MACHINE -- /snap/bin/microstack.openstack endpoint list | grep "10.20.20.1"; then + echo "Endpoints are not set to 10.20.20.1!"; + exit 1; +fi +# List of endpoints should not contain localhost +if multipass exec $MACHINE -- /snap/bin/microstack.openstack endpoint list | grep "localhost"; then + echo "Endpoints are not set to 10.20.20.1!"; + exit 1; +fi + + +# Verify that microstack.launch completed IP=$(multipass exec $MACHINE -- /snap/bin/microstack.openstack server list | grep breakfast | cut -d" " -f9) echo "Waiting for ping..." PINGS=1