-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add test for the files should be created
Signed-off-by: Vicente Cheng <[email protected]> (cherry picked from commit 28fb14a)
- Loading branch information
1 parent
df39bc7
commit 4b6f3a6
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash -ex | ||
|
||
if [[ $# != 1 ]] | ||
then | ||
echo "We need the settings.yaml from ipxe repo" | ||
exit 1 | ||
fi | ||
|
||
SETTINGS=$1 | ||
|
||
EXISTING_FILES="/oem/grubenv /oem/grubcustom" | ||
NODE0_IP=$(yq e ".harvester_network_config.cluster[0].ip" ${SETTINGS}) | ||
|
||
echo "Check files that should exist." | ||
|
||
SSHKEY=./tmp-ssh-key | ||
for filepath in ${EXISTING_FILES}; do | ||
echo "Prepare to check file: ${filepath} ..." | ||
if ! ssh -o "StrictHostKeyChecking no" -i tmp-ssh-key rancher@$NODE0_IP "sudo stat ${filepath}" | grep -q ${filepath}; then | ||
echo "${filepath} should exist, exit!" | ||
exit 1 | ||
fi | ||
done |