Changeset 43832 in vbox for trunk/src/VBox/Installer/linux/testcase
- Timestamp:
- Nov 7, 2012 2:37:42 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 81910
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/testcase/tstHeadlessXOrg.sh
r43797 r43832 69 69 HEADLESS_X_ORG_CHECK_PREREQUISITES= 70 70 HEADLESS_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}" 71 HEADLESS_X_ORG_SERVER_COMMAND="echo" 73 72 EOF 74 73 … … 95 94 # Create a temporary directory for configuration and logging. 96 95 for 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. 98 97 mkdir -m 0700 "${TEST_FOLDER}" 2>/dev/null && break 99 98 done … … 105 104 mkdir -p "${XORG_FOLDER}" 106 105 107 # Simple start-up test. 106 ############################################################################### 107 # Simple start-up test. # 108 ############################################################################### 108 109 print_line "simple start-up test" 109 110 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" … … 118 119 LOG_FOLDER="${TEST_FOLDER}/log" 119 120 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}"; then121 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 122 123 printf "SUCCESS.\n" 123 124 else … … 135 136 rm "${XORG_FOLDER}"/xorg.conf.* 136 137 137 # No configuration files. 138 ############################################################################### 139 # No configuration files. # 140 ############################################################################### 138 141 print_line "no configuration files" 139 142 … … 154 157 expect_exit "${PID}" 5 test_should_fail 155 158 156 # Bad configuration files. 159 ############################################################################### 160 # Bad configuration files. # 161 ############################################################################### 157 162 print_line "bad configuration files" 158 163 touch "${XORG_FOLDER}/xorg.conf.2" … … 164 169 rm "${XORG_FOLDER}/"xorg.conf.* 165 170 171 ############################################################################### 172 # Long running server command. # 173 ############################################################################### 174 166 175 # Set up a configuration file for a long-running command. 167 176 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" 168 177 cat >> "${TEST_FOLDER}/conf" << EOF 169 HEADLESS_X_ORG_SERVER_COMMAND="\"${TEST_NAME_FULL}\" --test-sleep \\\${screen}" 170 EOF 171 172 # Long running server command. 178 HEADLESS_X_ORG_SERVER_COMMAND="\"${TEST_NAME_FULL}\" --test-sleep" 179 EOF 180 173 181 print_line "long running server command (sleeps)" 174 182 touch "${XORG_FOLDER}/xorg.conf.1" … … 208 216 rm "${XORG_FOLDER}/"xorg.conf.* 209 217 218 ############################################################################### 219 # Pre-requisite test. # 220 ############################################################################### 221 210 222 # Set up a configuration file with a pre-requisite. 211 223 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" … … 214 226 EOF 215 227 216 # Pre-requisite test.217 228 print_line "configuration file with pre-requisite (sleeps)" 218 229 touch "${XORG_FOLDER}/xorg.conf.2" … … 231 242 rm -r "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}/run" 232 243 244 ############################################################################### 245 # Pre-command test. # 246 ############################################################################### 247 233 248 # Set up our pre-command test configuration file. 234 249 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" 250 235 251 cat >> "${TEST_FOLDER}/conf" << EOF 252 test_pre_command_server_command() 253 { 254 cp "${TEST_FOLDER}/run/pre" "${TEST_FOLDER}/run/pre2" 255 } 236 256 HEADLESS_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. 257 HEADLESS_X_ORG_SERVER_COMMAND="test_pre_command_server_command" 258 EOF 259 241 260 print_line "pre-command test" 242 261 touch "${XORG_FOLDER}/xorg.conf.2" … … 266 285 rm -f "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}"/run/pre* 267 286 287 ############################################################################### 288 # Post-command test. # 289 ############################################################################### 290 268 291 # Set up our post-command test configuration file. 269 292 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" 270 293 cat >> "${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. 294 test_post_command_post_command() 295 { 296 echo "\${1}" > "${TEST_FOLDER}/run/post" 297 } 298 HEADLESS_X_ORG_SERVER_POST_COMMAND="test_post_command_post_command" 299 EOF 300 276 301 print_line "post-command test" 277 302 touch "${XORG_FOLDER}/xorg.conf.2" … … 285 310 LOG_FOLDER="${TEST_FOLDER}/log" 286 311 LOG="${LOG_FOLDER}/log" 287 if [ -e "${TEST_FOLDER}/run/post" ]; then312 if grep -q "2 4" "${TEST_FOLDER}/run/post"; then 288 313 printf "SUCCESS.\n" 289 314 else
Note:
See TracChangeset
for help on using the changeset viewer.