Skip to content

Commit 5ed5b9b

Browse files
authored
Merge pull request #1959 from larsewi/prepare-testmachine
ENT-12600: prepare-testmachine: documented & refactored script
2 parents be9ba7b + 933d8d5 commit 5ed5b9b

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

build-scripts/prepare-testmachine

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1-
#!/bin/sh -x
1+
#!/bin/sh
22

3+
# Prepare a test machine environment for running CFEngine tests
4+
# Called by the test script when TEST_MACHINE is set
5+
#
6+
# Environment Variables:
7+
# TEST_MACHINE - Type of test machine to prepare (e.g., 'chroot')
8+
#
9+
# Description:
10+
# This script dispatches to the appropriate test machine preparation script
11+
# based on the TEST_MACHINE environment variable. Currently supports:
12+
# - chroot: Creates/configures a chroot environment for isolated testing
13+
#
14+
# Additional test machine types (VMs, containers, etc.) can be added here.
15+
16+
# Load shared functions and environment configuration
317
. "$(dirname "$0")"/functions
418
. detect-environment
519
. compile-options
620

21+
log_debug "Preparing test machine (TEST_MACHINE=$TEST_MACHINE)"
22+
23+
# Dispatch to appropriate test machine preparation script
724
case "$TEST_MACHINE" in
825
chroot)
26+
# Prepare a chroot-based test environment
927
"$BASEDIR"/buildscripts/build-scripts/prepare-testmachine-chroot
1028
;;
1129
*)
1230
# Add VMs, etc here.
13-
echo "Only chroot test machines are supported at the moment."
31+
log_error "Unsupported test machine type: $TEST_MACHINE: Only chroot test machines are supported at the moment."
1432
exit 1
1533
;;
1634
esac

0 commit comments

Comments
 (0)