VirtualBox

Ignore:
Timestamp:
Nov 7, 2012 2:37:42 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81910
Message:

Installer/linux: HeadlessXOrg clean-up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/testcase/tstHeadlessXOrg.sh

    r43797 r43832  
    6969HEADLESS_X_ORG_CHECK_PREREQUISITES=
    7070HEADLESS_X_ORG_SERVER_PRE_COMMAND=
    71 HEADLESS_X_ORG_SERVER_COMMAND="echo \\\${screen} \\\${conf_file} \\\${log_file}"
    72 HEADLESS_X_ORG_SERVER_LOG_FILE_TEMPLATE="log.\\\${screen}"
     71HEADLESS_X_ORG_SERVER_COMMAND="echo"
    7372EOF
    7473
     
    9594# Create a temporary directory for configuration and logging.
    9695for i in 0 1 2 3 4 5 6 7 8 9; do
    97   TEST_FOLDER="/tmp/${TEST_NAME}${i}"
     96  TEST_FOLDER="/tmp/${TEST_NAME} ${i}"  # Space in the name to test quoting.
    9897  mkdir -m 0700 "${TEST_FOLDER}" 2>/dev/null && break
    9998done
     
    105104mkdir -p "${XORG_FOLDER}"
    106105
    107 # Simple start-up test.
     106###############################################################################
     107# Simple start-up test.                                                       #
     108###############################################################################
    108109print_line "simple start-up test"
    109110create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}"
     
    118119    LOG_FOLDER="${TEST_FOLDER}/log"
    119120    LOG="${LOG_FOLDER}/log"
    120     if grep -q "2 ${XORG_FOLDER}/xorg.conf.2 ${LOG_FOLDER}/log.2" "${LOG}" &&
    121       grep -q "4 ${XORG_FOLDER}/xorg.conf.4 ${LOG_FOLDER}/log.4" "${LOG}"; then
     121    if grep -q "2 ${XORG_FOLDER}/xorg.conf.2 ${LOG_FOLDER}/Xorg.2.log" "${LOG}" &&
     122      grep -q "4 ${XORG_FOLDER}/xorg.conf.4 ${LOG_FOLDER}/Xorg.4.log" "${LOG}"; then
    122123      printf "SUCCESS.\n"
    123124    else
     
    135136rm "${XORG_FOLDER}"/xorg.conf.*
    136137
    137 # No configuration files.
     138###############################################################################
     139# No configuration files.                                                     #
     140###############################################################################
    138141print_line "no configuration files"
    139142
     
    154157expect_exit "${PID}" 5 test_should_fail
    155158
    156 # Bad configuration files.
     159###############################################################################
     160# Bad configuration files.                                                    #
     161###############################################################################
    157162print_line "bad configuration files"
    158163touch "${XORG_FOLDER}/xorg.conf.2"
     
    164169rm "${XORG_FOLDER}/"xorg.conf.*
    165170
     171###############################################################################
     172# Long running server command.                                                #
     173###############################################################################
     174
    166175# Set up a configuration file for a long-running command.
    167176create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}"
    168177cat >> "${TEST_FOLDER}/conf" << EOF
    169 HEADLESS_X_ORG_SERVER_COMMAND="\"${TEST_NAME_FULL}\" --test-sleep \\\${screen}"
    170 EOF
    171 
    172 # Long running server command.
     178HEADLESS_X_ORG_SERVER_COMMAND="\"${TEST_NAME_FULL}\" --test-sleep"
     179EOF
     180
    173181print_line "long running server command (sleeps)"
    174182touch "${XORG_FOLDER}/xorg.conf.1"
     
    208216rm "${XORG_FOLDER}/"xorg.conf.*
    209217
     218###############################################################################
     219# Pre-requisite test.                                                         #
     220###############################################################################
     221
    210222# Set up a configuration file with a pre-requisite.
    211223create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}"
     
    214226EOF
    215227
    216 # Pre-requisite test.
    217228print_line "configuration file with pre-requisite (sleeps)"
    218229touch "${XORG_FOLDER}/xorg.conf.2"
     
    231242rm -r "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}/run"
    232243
     244###############################################################################
     245# Pre-command test.                                                           #
     246###############################################################################
     247
    233248# Set up our pre-command test configuration file.
    234249create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}"
     250
    235251cat >> "${TEST_FOLDER}/conf" << EOF
     252test_pre_command_server_command()
     253{
     254  cp "${TEST_FOLDER}/run/pre" "${TEST_FOLDER}/run/pre2"
     255}
    236256HEADLESS_X_ORG_SERVER_PRE_COMMAND="touch \"${TEST_FOLDER}/run/pre\""
    237 HEADLESS_X_ORG_SERVER_COMMAND="cp \"${TEST_FOLDER}/run/pre\" \"${TEST_FOLDER}/run/pre2\""
    238 EOF
    239 
    240 # Pre-command test.
     257HEADLESS_X_ORG_SERVER_COMMAND="test_pre_command_server_command"
     258EOF
     259
    241260print_line "pre-command test"
    242261touch "${XORG_FOLDER}/xorg.conf.2"
     
    266285rm -f "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}"/run/pre*
    267286
     287###############################################################################
     288# Post-command test.                                                          #
     289###############################################################################
     290
    268291# Set up our post-command test configuration file.
    269292create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}"
    270293cat >> "${TEST_FOLDER}/conf" << EOF
    271 HEADLESS_X_ORG_SERVER_COMMAND="rm -f \"${TEST_FOLDER}/run/post\""
    272 HEADLESS_X_ORG_SERVER_POST_COMMAND="touch \"${TEST_FOLDER}/run/post\""
    273 EOF
    274 
    275 # Post-command test.
     294test_post_command_post_command()
     295{
     296  echo "\${1}" > "${TEST_FOLDER}/run/post"
     297}
     298HEADLESS_X_ORG_SERVER_POST_COMMAND="test_post_command_post_command"
     299EOF
     300
    276301print_line "post-command test"
    277302touch "${XORG_FOLDER}/xorg.conf.2"
     
    285310    LOG_FOLDER="${TEST_FOLDER}/log"
    286311    LOG="${LOG_FOLDER}/log"
    287     if [ -e "${TEST_FOLDER}/run/post" ]; then
     312    if grep -q "2 4" "${TEST_FOLDER}/run/post"; then
    288313      printf "SUCCESS.\n"
    289314    else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette