Skip to content

Commit 6d26c4b

Browse files
committed
Add scalablity test with fakeIPA
Signed-off-by: Mohammed Boukhalfa <[email protected]>
1 parent 3c3569e commit 6d26c4b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

scripts/ci-e2e.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ source "${REPO_ROOT}/scripts/environment.sh"
2020
# Clone dev-env repo
2121
sudo mkdir -p ${WORKING_DIR}
2222
sudo chown "${USER}":"${USER}" ${WORKING_DIR}
23-
M3_DEV_ENV_REPO="https://github.com/metal3-io/metal3-dev-env.git"
24-
M3_DEV_ENV_BRANCH=main
23+
M3_DEV_ENV_REPO="https://github.com/Nordix/metal3-dev-env.git"
24+
M3_DEV_ENV_BRANCH=Integrate-fakeIPA/mohammed
2525
M3_DEV_ENV_PATH="${M3_DEV_ENV_PATH:-${WORKING_DIR}/metal3-dev-env}"
2626
clone_repo "${M3_DEV_ENV_REPO}" "${M3_DEV_ENV_BRANCH}" "${M3_DEV_ENV_PATH}"
2727

@@ -33,6 +33,8 @@ export NUM_NODES=${NUM_NODES:-"4"}
3333
export KUBERNETES_VERSION=${KUBERNETES_VERSION}
3434
export IMAGE_OS=${IMAGE_OS}
3535
export FORCE_REPO_UPDATE="false"
36+
export VM_PLATFORM="fake"
37+
export FAKE_IPA_I="192.168.111.1:5000/localimages/fake-ipa"
3638
EOF
3739
if [[ ${GINKGO_FOCUS:-} == "features" ]]; then
3840
mkdir -p "$CAPI_CONFIG_FOLDER"
@@ -65,6 +67,8 @@ source "${M3_DEV_ENV_PATH}/lib/releases.sh"
6567
source "${M3_DEV_ENV_PATH}/lib/ironic_basic_auth.sh"
6668
# shellcheck disable=SC1091,SC1090
6769
source "${M3_DEV_ENV_PATH}/lib/ironic_tls_setup.sh"
70+
# shellcheck disable=SC1091,SC1090
71+
source "/tmp/vars_cluster.sh"
6872

6973
# image for live iso testing
7074
export LIVE_ISO_IMAGE="https://artifactory.nordix.org/artifactory/metal3/images/iso/minimal_linux_live-v2.iso"

test/e2e/pivoting_based_feature_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
"sigs.k8s.io/cluster-api/test/framework"
1414
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
1515
"sigs.k8s.io/controller-runtime/pkg/client"
16+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
17+
infrav1 "github.com/metal3-io/cluster-api-provider-metal3/api/v1beta1"
18+
"net/http"
1619
)
1720

1821
var (
@@ -192,6 +195,27 @@ func createTargetCluster(k8sVersion string) (framework.ClusterProxy, *clusterctl
192195
ControlPlaneMachineCount: &controlPlaneMachineCount,
193196
WorkerMachineCount: &workerMachineCount,
194197
},
198+
PreWaitForCluster: func () {
199+
// get bmh
200+
// get m3m
201+
// waiting machine
202+
By("Waiting for all Machines to be provisioning")
203+
WaitForNumMachinesInState(ctx, clusterv1.MachinePhaseProvisioning, WaitForNumInput{
204+
Client: bootstrapClusterProxy.GetClient(),
205+
Options: []client.ListOption{client.InNamespace(namespace)},
206+
Replicas: 1,
207+
Intervals: e2eConfig.GetIntervals(specName, "wait-machine-remediation"),
208+
})
209+
210+
metal3Machines := infrav1.Metal3MachineList{}
211+
bootstrapClusterProxy.GetClient().List(ctx, &metal3Machines, []client.ListOption{client.InNamespace(namespace)}...)
212+
for _, m3machine := range metal3Machines.Items {
213+
providerID:="metal3://metal3/"+Metal3MachineToBmhName(m3machine)+"/"+m3machine.GetName()
214+
machine, _ := Metal3MachineToMachineName(m3machine)
215+
resp, err :=http.Get("http://localhost:3333/updateNode?resource=metal3/test1&nodeName="+machine+"&providerID="+providerID)
216+
Logf("resp : %v err: %v", resp, err)
217+
}
218+
},
195219
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
196220
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
197221
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),

0 commit comments

Comments
 (0)