162306a36Sopenharmony_ci# bootconfig.conf
262306a36Sopenharmony_ci#
362306a36Sopenharmony_ci# Tests to test some bootconfig scripts
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci# List where on the target machine the initrd is used
662306a36Sopenharmony_ciINITRD := /boot/initramfs-test.img
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci# Install bootconfig on the target machine and define the path here.
962306a36Sopenharmony_ciBOOTCONFIG := /usr/bin/bootconfig
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci# Currenty we just build the .config in the BUILD_DIR
1262306a36Sopenharmony_ciBUILD_TYPE := oldconfig
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci# Helper macro to run bootconfig on the target
1562306a36Sopenharmony_ci# SSH is defined in include/defaults.conf
1662306a36Sopenharmony_ciADD_BOOTCONFIG := ${SSH} "${BOOTCONFIG} -d ${INITRD} && ${BOOTCONFIG} -a /tmp/${BOOTCONFIG_FILE} ${INITRD}"
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci# This copies a bootconfig script to the target and then will
1962306a36Sopenharmony_ci# add it to the initrd. SSH_USER is defined in include/defaults.conf
2062306a36Sopenharmony_ci# and MACHINE is defined in the example configs.
2162306a36Sopenharmony_ciBOOTCONFIG_TEST_PREP = scp ${BOOTCONFIG_PATH}${BOOTCONFIG_FILE} ${SSH_USER}@${MACHINE}:/tmp && ${ADD_BOOTCONFIG}
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci# When a test is complete, remove the bootconfig from the initrd.
2462306a36Sopenharmony_ciCLEAR_BOOTCONFIG := ${SSH} "${BOOTCONFIG} -d ${INITRD}"
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci# Run a verifier on the target after it had booted, to make sure that the
2762306a36Sopenharmony_ci# bootconfig script did what it was expected to do
2862306a36Sopenharmony_ciDO_TEST = scp ${BOOTCONFIG_PATH}${BOOTCONFIG_VERIFY} ${SSH_USER}@${MACHINE}:/tmp && ${SSH} /tmp/${BOOTCONFIG_VERIFY}
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci# Comment this out to not run the boot configs
3162306a36Sopenharmony_ciRUN_BOOTCONFIG := 1
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ciTEST_START IF DEFINED RUN_BOOTCONFIG
3462306a36Sopenharmony_ciTEST_TYPE = test
3562306a36Sopenharmony_ciTEST_NAME = bootconfig boottrace
3662306a36Sopenharmony_ci# Just testing the bootconfig on initrd, no need to build the kernel
3762306a36Sopenharmony_ciBUILD_TYPE = nobuild
3862306a36Sopenharmony_ciBOOTCONFIG_FILE = boottrace.bconf
3962306a36Sopenharmony_ciBOOTCONFIG_VERIFY = verify-boottrace.sh
4062306a36Sopenharmony_ciADD_CONFIG = ${ADD_CONFIG} ${BOOTCONFIG_PATH}/config-bootconfig
4162306a36Sopenharmony_ciPRE_TEST = ${BOOTCONFIG_TEST_PREP}
4262306a36Sopenharmony_ciPRE_TEST_DIE = 1
4362306a36Sopenharmony_ciTEST = ${DO_TEST}
4462306a36Sopenharmony_ciPOST_TEST = ${CLEAR_BOOTCONFIG}
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ciTEST_START IF DEFINED RUN_BOOTCONFIG
4762306a36Sopenharmony_ciTEST_TYPE = test
4862306a36Sopenharmony_ciTEST_NAME = bootconfig function graph
4962306a36Sopenharmony_ciBUILD_TYPE = nobuild
5062306a36Sopenharmony_ciBOOTCONFIG_FILE = functiongraph.bconf
5162306a36Sopenharmony_ciBOOTCONFIG_VERIFY = verify-functiongraph.sh
5262306a36Sopenharmony_ciADD_CONFIG = ${ADD_CONFIG} ${BOOTCONFIG_PATH}/config-bootconfig
5362306a36Sopenharmony_ciPRE_TEST = ${BOOTCONFIG_TEST_PREP}
5462306a36Sopenharmony_ciPRE_TEST_DIE = 1
5562306a36Sopenharmony_ciTEST = ${DO_TEST}
5662306a36Sopenharmony_ciPOST_TEST = ${CLEAR_BOOTCONFIG}
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ciTEST_START IF DEFINED RUN_BOOTCONFIG
5962306a36Sopenharmony_ciTEST_TYPE = test
6062306a36Sopenharmony_ciTEST_NAME = bootconfig tracing
6162306a36Sopenharmony_ciBUILD_TYPE = nobuild
6262306a36Sopenharmony_ciBOOTCONFIG_FILE = tracing.bconf
6362306a36Sopenharmony_ciBOOTCONFIG_VERIFY = verify-tracing.sh
6462306a36Sopenharmony_ciADD_CONFIG = ${ADD_CONFIG} ${BOOTCONFIG_PATH}/config-bootconfig
6562306a36Sopenharmony_ciPRE_TEST = ${BOOTCONFIG_TEST_PREP}
6662306a36Sopenharmony_ciPRE_TEST_DIE = 1
6762306a36Sopenharmony_ciTEST = ${DO_TEST}
6862306a36Sopenharmony_ciPOST_TEST = ${CLEAR_BOOTCONFIG}
6962306a36Sopenharmony_ci
70