Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions build-scripts/prepare-testmachine
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
#!/bin/sh -x
#!/bin/sh

# 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

log_debug "Preparing test machine (TEST_MACHINE=$TEST_MACHINE)"

# 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
;;
*)
# 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
Loading