-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1767 from Nordix/mquhuy/create-bmh-go
🌱 Add new go library to create new bmc and bmh
- Loading branch information
Showing
14 changed files
with
490 additions
and
38 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
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,26 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script reads BMC information in a config file and prepare VMs | ||
# whose info match those config | ||
# | ||
set -x | ||
|
||
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") | ||
|
||
virsh pool-destroy default || true | ||
virsh pool-delete default || true | ||
virsh pool-undefine default || true | ||
|
||
CONFIG_FILE=$1 | ||
NETWORK=${2:-"baremetal-e2e"} | ||
|
||
readarray -t BMCS < <(yq e -o=j -I=0 '.[]' "${CONFIG_FILE}") | ||
|
||
for bmc in "${BMCS[@]}"; do | ||
bootMacAddress=$(echo "${bmc}" | jq -r '.bootMacAddress') | ||
ipAddress=$(echo "${bmc}" | jq -r '.ipAddress') | ||
virsh -c qemu:///system net-update "${NETWORK}" delete ip-dhcp-host "<host mac='${bootMacAddress}' ip='${ipAddress}'/>" --live --config | ||
done | ||
"${REPO_ROOT}/tools/bmh_test/clean_local_bmh_test_setup.sh" "^bmo-e2e-" | ||
rm -rf /tmp/bmo-e2e-* | ||
rm -rf /tmp/pool_oo |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.