feat(test): Improve gitfs tests with salt-minion integration
This commit is contained in:
@@ -34,9 +34,26 @@ UPDATE_REPOS="$( salt-run fileserver.update )"
|
||||
echo "${UPDATE_REPOS}" | grep -qi true || error "update gitfs"
|
||||
ok "update gitfs"
|
||||
|
||||
# Check pillars
|
||||
# Check gitfs files
|
||||
echo "==> Checking gitfs files ..."
|
||||
FILE_LIST=$( salt-run fileserver.file_list )
|
||||
echo "${FILE_LIST}"
|
||||
[[ "${FILE_LIST}" == *test.txt* ]] || error "gitfs files"
|
||||
ok "gitfs files"
|
||||
|
||||
# Test minion connection
|
||||
setup_and_start_salt_minion || error "salt-minion started"
|
||||
ok "salt-minion started"
|
||||
|
||||
# Test pillar
|
||||
echo "==> Checking gitfs pillar docker-salt-master-test:email content from minion ..."
|
||||
PILLAR_CONTENT="$( salt "${TEST_MINION_ID}" pillar.get 'docker-salt-master-test:email' || error "Unable to get pillar 'docker-salt-master-test:email'" )"
|
||||
echo "${PILLAR_CONTENT}"
|
||||
echo -n "${PILLAR_CONTENT}" | grep -q 'github@cdalvaro.io' || error "Check gitfs pillar 'docker-salt-master-test:email'"
|
||||
ok "Check gitfs pillar 'docker-salt-master-test:email'"
|
||||
|
||||
# Test gitfs deploy
|
||||
echo "==> Checking gitfs top.sls (state.apply) ..."
|
||||
salt "${TEST_MINION_ID}" state.apply
|
||||
[ -f /tmp/my_file.txt ] || error "Check gitfs top.sls applied"
|
||||
ok "Check gitfs top.sls applied"
|
||||
|
||||
Reference in New Issue
Block a user