Fix cloudinit mariadb scenario test error

For now mariadb scenario single test case fails because the script
cannot find cloudinit file.

This change adds cloudinit file creation if the file doesn't exist.

Before this patch we were getting the following message:
    tee: /etc/trove/cloudinit/mysql.cloudinit: No such file or
    directory
    #!/bin/sh
    ERROR: InvocationError for command /opt/stack/trove/integration/
    scripts/trovestack gate-tests mariadb mariadb-supported-single
    (exited with code 1)

Change-Id: Iea74dc2c58b1c4376c698f0084454cfcbb3f3b7d
Signed-off-by: Kasper Hasior <k.hasior@samsung.com>
This commit is contained in:
Kasper Hasior 2019-04-16 13:54:46 +02:00
parent f4e17a34b9
commit 7f7ae90ee9
1 changed files with 3 additions and 0 deletions

View File

@ -1341,6 +1341,9 @@ function cmd_gate_tests() {
CLOUDINIT_PATH=/etc/trove/cloudinit/mysql.cloudinit
PUBKEY=`cat ${HOME}/.ssh/id_rsa.pub`
sudo mkdir -p $(dirname "$CLOUDINIT_PATH")
sudo touch "$CLOUDINIT_PATH"
sudo echo "#!/bin/sh" | sudo tee $CLOUDINIT_PATH
sudo echo "" | sudo tee -a $CLOUDINIT_PATH
sudo echo "echo '${PUBKEY}' > /home/ubuntu/.ssh/authorized_keys" | sudo tee -a $CLOUDINIT_PATH