summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-06-12 16:42:54 -0600
committerChad Smith <chad.smith@canonical.com>2018-06-12 16:42:54 -0600
commit27283c31f4bf85f40588cfa3b31389d70ec00243 (patch)
tree67dc71a93664ca48616324d93bac6cb26d692347
parentd0f6c4602f9cc412d372e10bd7411ff0214c1435 (diff)
downloadvyos-cloud-init-27283c31f4bf85f40588cfa3b31389d70ec00243.tar.gz
vyos-cloud-init-27283c31f4bf85f40588cfa3b31389d70ec00243.zip
tests: fix salt_minion integration test on bionic and later
In ubuntu, the salt-minion package version 2017.7.4+dfsg1-1 or later automatically moves any seed keys from /etc/salt/pki/minion/ to /var/lib/salt/pki/minion/. Fix integration tests to collect either files in either /etc/salt/pki/minion/ or /var/lib/salt/pki/minion/.
-rw-r--r--tests/cloud_tests/testcases/modules/salt_minion.yaml14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/cloud_tests/testcases/modules/salt_minion.yaml b/tests/cloud_tests/testcases/modules/salt_minion.yaml
index c24aa177..9227147c 100644
--- a/tests/cloud_tests/testcases/modules/salt_minion.yaml
+++ b/tests/cloud_tests/testcases/modules/salt_minion.yaml
@@ -28,10 +28,20 @@ collect_scripts:
cat /etc/salt/minion_id
minion.pem: |
#!/bin/bash
- cat /etc/salt/pki/minion/minion.pem
+ PRIV_KEYFILE=/etc/salt/pki/minion/minion.pem
+ if [ ! -f $PRIV_KEYFILE ]; then
+ # Bionic and later automatically moves /etc/salt/pki/minion/*
+ PRIV_KEYFILE=/var/lib/salt/pki/minion/minion.pem
+ fi
+ cat $PRIV_KEYFILE
minion.pub: |
#!/bin/bash
- cat /etc/salt/pki/minion/minion.pub
+ PUB_KEYFILE=/etc/salt/pki/minion/minion.pub
+ if [ ! -f $PUB_KEYFILE ]; then
+ # Bionic and later automatically moves /etc/salt/pki/minion/*
+ PUB_KEYFILE=/var/lib/salt/pki/minion/minion.pub
+ fi
+ cat $PUB_KEYFILE
grains: |
#!/bin/bash
cat /etc/salt/grains