labctl: dépôt autonome — module git.g3e.fr/syonad/labctl, exemple evpn-2hv, LABCTL_BIN, licence, README, CI
Some checks failed
Tests / test (push) Successful in 4m12s
Release Pipeline / set-release-target (push) Successful in 2s
Release Pipeline / upload-assets (lab-host.sh, scripts/lab-host.sh) (push) Successful in 7s
Release Pipeline / build (push) Successful in 1m31s
Release Pipeline / build (amd64, linux) (push) Successful in 0s
Release Pipeline / build (arm64, darwin) (push) Successful in 0s
Release Pipeline / checksums (push) Successful in 6s
Release Pipeline / release (push) Failing after 22s
Release Pipeline / publish (push) Failing after 0s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-12 16:33:02 +02:00
commit ef7392f09b
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
31 changed files with 766 additions and 36 deletions

View file

@ -227,7 +227,7 @@ lab_env () {
SCW_DEFAULT_PROJECT_ID="${PROJECT}" LAB_POLL_INTERVAL="${LAB_POLL_INTERVAL:-0}" \
LAB_INSTALL_TIMEOUT="${LAB_INSTALL_TIMEOUT:-60}" LAB_DELETE_TIMEOUT="${LAB_DELETE_TIMEOUT:-60}" \
LAB_SSH_TIMEOUT="${LAB_SSH_TIMEOUT:-60}" LAB_ZONES="${LAB_ZONES:-fr-par-1}" \
LAB_OFFER="${LAB_OFFER:-EM-B212X-SSD}" ${SCW_DEFAULT_ZONE:+SCW_DEFAULT_ZONE="${SCW_DEFAULT_ZONE}"} \
LAB_OFFER="${LAB_OFFER:-EM-B212X-SSD}" ${SCW_DEFAULT_ZONE:+SCW_DEFAULT_ZONE="${SCW_DEFAULT_ZONE}"} ${LABCTL_BIN:+LABCTL_BIN="${LABCTL_BIN}"} \
"$@"
}
@ -725,6 +725,31 @@ test_push_stops_when_the_build_fails () {
teardown
}
test_push_sends_a_provided_binary_without_building () {
setup "push : LABCTL_BIN est envoyé tel quel, sans compilation"
known_server
printf 'name: x\n' > "${WORK}/x.yml"
printf 'binaire-de-release' > "${WORK}/labctl-release"
chmod 755 "${WORK}/labctl-release"
LABCTL_BIN="${WORK}/labctl-release" run_lab push "${WORK}/x.yml" || fail "code de sortie $?"
[[ -s "${WORK}/go.log" ]] && fail "compilation lancée : $(cat "${WORK}/go.log")"
[[ $(cat "${WORK}/pushed.1") == "binaire-de-release" ]] || fail "contenu envoyé : $(cat "${WORK}/pushed.1")"
teardown
}
test_push_refuses_a_provided_binary_that_is_not_executable () {
setup "push : LABCTL_BIN absent ou non exécutable refusé avant tout envoi"
known_server
printf 'name: x\n' > "${WORK}/x.yml"
printf 'x' > "${WORK}/labctl-release"
for BIN in "${WORK}/absent" "${WORK}/labctl-release"; do
LABCTL_BIN="${BIN}" run_lab push "${WORK}/x.yml" && fail "push a réussi avec ${BIN}"
grep -q "LABCTL_BIN n'est pas un exécutable" "${WORK}/out.log" || fail "message absent pour ${BIN}"
done
[[ -s "${WORK}/ssh.log" ]] && fail "ssh lancé"
teardown
}
test_push_fails_when_a_transfer_fails () {
setup "push : un envoi échoué fait échouer push"
known_server