Skip to content

Commit

Permalink
Merge pull request metal3-io#1786 from Nordix/fix_deploy_htpass
Browse files Browse the repository at this point in the history
🐛 Fix incorrect htpasswd file generation
  • Loading branch information
metal3-io-bot authored and mquhuy committed Jun 19, 2024
2 parents 536b43c + 73f9e0a commit b7a1406
Show file tree
Hide file tree
Showing 14 changed files with 385 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
contents: write

steps:
- name: Install libvirt-dev
run: sudo apt-get install -y libvirt-dev
- name: Check out code into the Go module directory
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Calculate go version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-fixture-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install libvirt-dev
run: sudo apt-get install -y libvirt-dev

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Calculate go version
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager
sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager libvirt-dev
- name: Run BMO e2e Tests
env:
Expand All @@ -45,6 +45,7 @@ jobs:
sudo -s -u $USER --preserve-env bash ${{ github.workspace }}/hack/ci-e2e.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: artifacts-${{ inputs.bmc-protocol }}.tar.gz
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
- apis
- pkg/hardwareutils
steps:
- name: Install libvirt-dev
run: sudo apt-get install -y libvirt-dev
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
Expand Down
22 changes: 22 additions & 0 deletions clean_bmcs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
# This script reads BMC information in a config file and prepare VMs
# whose info match those config
#
set -eux

REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "${REPO_ROOT}"

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-*
6 changes: 5 additions & 1 deletion hack/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ else
exit 1
fi

"${REPO_ROOT}/hack/create_bmcs.sh" "${E2E_BMCS_CONF_FILE}" baremetal-e2e
# "${REPO_ROOT}/hack/create_bmcs.sh" "${E2E_BMCS_CONF_FILE}" baremetal-e2e
pushd "${REPO_ROOT}/test/createVM" || exit 1
go run main.go --yaml-source-file "${E2E_BMCS_CONF_FILE}"
popd

# Image server variables
CIRROS_VERSION="0.6.2"
Expand All @@ -118,6 +121,7 @@ mkdir -p "${IMAGE_DIR}"
## Download disk images
wget --quiet -P "${IMAGE_DIR}/" https://artifactory.nordix.org/artifactory/metal3/images/iso/"${IMAGE_FILE}"
wget --quiet -P "${IMAGE_DIR}/" https://fastly-cdn.system-rescue.org/releases/11.00/systemrescue-11.00-amd64.iso
wget --quiet -P "${IMAGE_DIR}/" https://artifactory.nordix.org/artifactory/metal3/images/iso/minimal_linux_live-v2.iso

## Start the image server
docker run --name image-server-e2e -d \
Expand Down
4 changes: 4 additions & 0 deletions hack/clean-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ docker rm -f sushy-tools
rm -rf "${REPO_ROOT}/test/e2e/_artifacts"
rm -rf "${REPO_ROOT}"/artifacts-*
rm -rf "${REPO_ROOT}/test/e2e/images"

# Clear network
virsh -c qemu:///system net-destroy baremetal-e2e
virsh -c qemu:///system net-undefine baremetal-e2e
Loading

0 comments on commit b7a1406

Please sign in to comment.