From eb233a4b792acd90734fb662e79c5d73237b3bdc Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 1 Oct 2025 13:09:06 +0200 Subject: [PATCH 1/3] prepare-testmachine: documented script Ticket: ENT-12600 Signed-off-by: Lars Erik Wik --- build-scripts/prepare-testmachine | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build-scripts/prepare-testmachine b/build-scripts/prepare-testmachine index 40fa47e00..7eddc1b63 100755 --- a/build-scripts/prepare-testmachine +++ b/build-scripts/prepare-testmachine @@ -1,11 +1,27 @@ #!/bin/sh -x +# Prepare a test machine environment for running CFEngine tests +# Called by the test script when TEST_MACHINE is set +# +# Environment Variables: +# TEST_MACHINE - Type of test machine to prepare (e.g., 'chroot') +# +# Description: +# This script dispatches to the appropriate test machine preparation script +# based on the TEST_MACHINE environment variable. Currently supports: +# - chroot: Creates/configures a chroot environment for isolated testing +# +# Additional test machine types (VMs, containers, etc.) can be added here. + +# Load shared functions and environment configuration . "$(dirname "$0")"/functions . detect-environment . compile-options +# Dispatch to appropriate test machine preparation script case "$TEST_MACHINE" in chroot) + # Prepare a chroot-based test environment "$BASEDIR"/buildscripts/build-scripts/prepare-testmachine-chroot ;; *) From bb37a9b763b6466ff7590ba0435821187f68c2b1 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 1 Oct 2025 13:09:41 +0200 Subject: [PATCH 2/3] prepare-testmachine: decreased verbosity of script Signed-off-by: Lars Erik Wik --- build-scripts/prepare-testmachine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/prepare-testmachine b/build-scripts/prepare-testmachine index 7eddc1b63..9f2b14f82 100755 --- a/build-scripts/prepare-testmachine +++ b/build-scripts/prepare-testmachine @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh # Prepare a test machine environment for running CFEngine tests # Called by the test script when TEST_MACHINE is set From 933d8d53daa99d08a086f0d7acb2c2118c086ef4 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 1 Oct 2025 13:11:30 +0200 Subject: [PATCH 3/3] prepare-testmachine: added logging to aid debugging Signed-off-by: Lars Erik Wik --- build-scripts/prepare-testmachine | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-scripts/prepare-testmachine b/build-scripts/prepare-testmachine index 9f2b14f82..4b7d2ffad 100755 --- a/build-scripts/prepare-testmachine +++ b/build-scripts/prepare-testmachine @@ -18,6 +18,8 @@ . detect-environment . compile-options +log_debug "Preparing test machine (TEST_MACHINE=$TEST_MACHINE)" + # Dispatch to appropriate test machine preparation script case "$TEST_MACHINE" in chroot) @@ -26,7 +28,7 @@ chroot) ;; *) # Add VMs, etc here. - echo "Only chroot test machines are supported at the moment." + log_error "Unsupported test machine type: $TEST_MACHINE: Only chroot test machines are supported at the moment." exit 1 ;; esac