Changeset 66800 in vbox for trunk/src/VBox/ValidationKit/testboxscript
- Timestamp:
- May 4, 2017 11:55:34 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115217
- Location:
- trunk/src/VBox/ValidationKit/testboxscript
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/darwin/setup-routines.sh
r66770 r66800 5 5 6 6 # 7 # Copyright (C) 2006-201 5Oracle Corporation7 # Copyright (C) 2006-2017 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 28 28 29 29 ## 30 # Checks for a boolean option pair --$2/--no-$2 in the XMLARGS variable,31 # storing the result in the TESTBOXSCRIPT_XXX variable $1.32 darwin_check_for_option_bool() {33 MY_TMP=`echo "${XMLARGS}" | sed -ne 's|^.*<string>--'"$2"'</string>.*$|yes|p'`34 if [ -n "${MY_TMP}" ]; then35 eval $1="yes";36 fi37 MY_TMP=`echo "${XMLARGS}" | sed -ne 's|^.*<string>--no-'"$2"'</string>.*$|yes|p'`38 if [ -n "${MY_TMP}" ]; then39 eval $1="no";40 fi41 return 0;42 }43 44 ##45 # Checks for an option $2 taking an argument, storing the result in the46 # TESTBOXSCRIPT_XXX variable $1.47 darwin_check_for_option_arg() {48 MY_TMP=`echo "${XMLARGS}" | sed -ne 's|^.*<string>--'"$2"'</string> *<string>\([^<>]*\)</string>.*$|\1|p'`49 if [ -n "${MY_TMP}" ]; then50 eval $1="\"${MY_TMP}\"";51 fi52 return 0;53 }54 55 ##56 30 # Loads config values from the current installation. 57 31 # … … 74 48 -e 's|\(</[[:alnum:]]*>\)<|\1 <|g' \ 75 49 -e 's|^.*ProgramArguments</key> *<array> *\(.*\)</array>.*$|\1|'`; 76 77 darwin_check_for_option_arg TESTBOXSCRIPT_SYSTEM_UUID system-uuid 78 darwin_check_for_option_arg TESTBOXSCRIPT_SCRATCH_ROOT scratch-root 79 darwin_check_for_option_arg TESTBOXSCRIPT_TEST_MANAGER test-manager 80 darwin_check_for_option_bool TESTBOXSCRIPT_HWVIRT hwvirt 81 darwin_check_for_option_bool TESTBOXSCRIPT_NESTED_PAGING nested-paging 82 darwin_check_for_option_bool TESTBOXSCRIPT_IOMMU io-mmu 83 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_PATH builds-path 84 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_TYPE builds-server-type 85 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_NAME builds-server-name 86 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_SHARE builds-server-share 87 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_USER builds-server-user 88 darwin_check_for_option_arg TESTBOXSCRIPT_BUILDS_PASSWD builds-server-passwd 89 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_PATH testrsrc-path 90 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_TYPE testrsrc-server-type 91 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_NAME testrsrc-server-name 92 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_SHARE testrsrc-server-share 93 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_USER testrsrc-server-user 94 darwin_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_PASSWD testrsrc-server-passwd 95 96 ## @TODO darwin_check_for_option_arg TESTBOXSCRIPT_PYTHON python 50 eval common_testboxscript_args_to_config `echo "${XMLARGS}" | sed -e "s/<string>/'/g" -e "s/<\/string>/'/g" `; 97 51 fi 98 52 } … … 101 55 # Adds an argument ($1) to MY_ARGV (XML plist format). 102 56 # 103 darwin_add_args() {57 os_add_args() { 104 58 while [ $# -gt 0 ]; 105 59 do … … 121 75 122 76 os_install_service() { 77 # Calc the command line. 123 78 MY_ARGV="" 124 if [ -n "${TESTBOXSCRIPT_PYTHON}" ]; then 125 darwin_add_args "${TESTBOXSCRIPT_PYTHON}" 126 fi 127 darwin_add_args "${TESTBOXSCRIPT_DIR}/testboxscript/testboxscript.py" 79 common_compile_testboxscript_command_line 128 80 129 if [ "${TESTBOXSCRIPT_HWVIRT}" = "yes" ]; then darwin_add_args "--hwvirt"; fi130 if [ "${TESTBOXSCRIPT_HWVIRT}" = "no" ]; then darwin_add_args "--no-hwvirt"; fi131 if [ "${TESTBOXSCRIPT_NESTED_PAGING}" = "yes" ]; then darwin_add_args "--nested-paging"; fi132 if [ "${TESTBOXSCRIPT_NESTED_PAGING}" = "no" ]; then darwin_add_args "--no-nested-paging"; fi133 if [ "${TESTBOXSCRIPT_IOMMU}" = "yes" ]; then darwin_add_args "--io-mmu"; fi134 if [ "${TESTBOXSCRIPT_IOMMU}" = "no" ]; then darwin_add_args "--no-io-mmu"; fi135 if [ -n "${TESTBOXSCRIPT_SYSTEM_UUID}" ]; then darwin_add_args "--system-uuid" "${TESTBOXSCRIPT_SYSTEM_UUID}"; fi136 if [ -n "${TESTBOXSCRIPT_TEST_MANAGER}" ]; then darwin_add_args "--test-manager" "${TESTBOXSCRIPT_TEST_MANAGER}"; fi137 if [ -n "${TESTBOXSCRIPT_SCRATCH_ROOT}" ]; then darwin_add_args "--scratch-root" "${TESTBOXSCRIPT_SCRATCH_ROOT}"; fi138 139 if [ -n "${TESTBOXSCRIPT_BUILDS_PATH}" ]; then darwin_add_args "--builds-path" "${TESTBOXSCRIPT_BUILDS_PATH}"; fi140 if [ -n "${TESTBOXSCRIPT_BUILDS_TYPE}" ]; then darwin_add_args "--builds-server-type" "${TESTBOXSCRIPT_BUILDS_TYPE}"; fi141 if [ -n "${TESTBOXSCRIPT_BUILDS_NAME}" ]; then darwin_add_args "--builds-server-name" "${TESTBOXSCRIPT_BUILDS_NAME}"; fi142 if [ -n "${TESTBOXSCRIPT_BUILDS_SHARE}" ]; then darwin_add_args "--builds-server-share" "${TESTBOXSCRIPT_BUILDS_SHARE}"; fi143 if [ -n "${TESTBOXSCRIPT_BUILDS_USER}" ]; then darwin_add_args "--builds-server-user" "${TESTBOXSCRIPT_BUILDS_USER}"; fi144 if [ -n "${TESTBOXSCRIPT_BUILDS_PASSWD}" ]; then darwin_add_args "--builds-server-passwd" "${TESTBOXSCRIPT_BUILDS_PASSWD}"; fi145 if [ -n "${TESTBOXSCRIPT_TESTRSRC_PATH}" ]; then darwin_add_args "--testrsrc-path" "${TESTBOXSCRIPT_PATH_TESTRSRC}"; fi146 if [ -n "${TESTBOXSCRIPT_BUILDS_TYPE}" ]; then darwin_add_args "--testrsrc-server-type" "${TESTBOXSCRIPT_TESTRSRC_TYPE}"; fi147 if [ -n "${TESTBOXSCRIPT_BUILDS_NAME}" ]; then darwin_add_args "--testrsrc-server-name" "${TESTBOXSCRIPT_TESTRSRC_NAME}"; fi148 if [ -n "${TESTBOXSCRIPT_BUILDS_SHARE}" ]; then darwin_add_args "--testrsrc-server-share" "${TESTBOXSCRIPT_TESTRSRC_SHARE}"; fi149 if [ -n "${TESTBOXSCRIPT_BUILDS_USER}" ]; then darwin_add_args "--testrsrc-server-user" "${TESTBOXSCRIPT_TESTRSRC_USER}"; fi150 if [ -n "${TESTBOXSCRIPT_BUILDS_PASSWD}" ]; then darwin_add_args "--testrsrc-server-passwd" "${TESTBOXSCRIPT_TESTRSRC_PASSWD}"; fi151 81 152 82 # Note! It's not possible to use screen 4.0.3 with the launchd due to buggy … … 177 107 178 108 os_enable_service() { 179 launchctl load "${MY_CONFIG_FILE}"109 launchctl load -w "${MY_CONFIG_FILE}" 180 110 return 0; 181 111 } -
trunk/src/VBox/ValidationKit/testboxscript/linux/setup-routines.sh
r66786 r66800 6 6 7 7 # 8 # Copyright (C) 2006-201 5Oracle Corporation8 # Copyright (C) 2006-2017 Oracle Corporation 9 9 # 10 10 # This file is part of VirtualBox Open Source Edition (OSE), as … … 60 60 61 61 # 62 # Work around a bug with arrays in old bash versions.63 #64 if [ ${#TESTBOXSCRIPT_ENVVARS[@]} -eq 0 ]; then65 unset TESTBOXSCRIPT_ENVVARS66 fi67 68 #69 62 # Install the configuration file. 70 63 # 71 echo "# Generated by $0." > "${MY_CONFIG_FILE}" 72 set | sed -n -e '/^TESTBOXSCRIPT_/p' >> "${MY_CONFIG_FILE}" 64 echo "# Generated by $0." > "${MY_CONFIG_FILE}" 65 for var in ${TESTBOXSCRIPT_CFG_NAMES}; 66 do 67 varcfg=TESTBOXSCRIPT_${var} 68 vardef=TESTBOXSCRIPT_DEFAULT_${var} 69 if [ "${!varcfg}" = "${!vardef}" ]; then 70 echo "# using default value: ${varcfg}=${!varcfg}" >> "${MY_CONFIG_FILE}" 71 else 72 echo "${varcfg}=${!varcfg}" >> "${MY_CONFIG_FILE}" 73 fi 74 done 75 76 # Work around a bug with arrays in old bash versions. 77 if [ ${#TESTBOXSCRIPT_ENVVARS[@]} -ne 0 ]; then 78 set | sed -n -e '/^TESTBOXSCRIPT_ENVVARS=/p' >> "${MY_CONFIG_FILE}" 79 fi 73 80 return 0; 74 81 } -
trunk/src/VBox/ValidationKit/testboxscript/setup.sh
r66798 r66800 6 6 7 7 # 8 # Copyright (C) 2006-201 5Oracle Corporation8 # Copyright (C) 2006-2017 Oracle Corporation 9 9 # 10 10 # This file is part of VirtualBox Open Source Edition (OSE), as … … 334 334 } 335 335 336 ## 337 # Parses the testboxscript.py invocation, setting TESTBOXSCRIPT_xxx config 338 # variables accordingly. Both darwin and solaris uses this. 339 common_testboxscript_args_to_config() 340 { 341 MY_ARG=0 342 while [ $# -gt 0 ]; 343 do 344 case "$1" in 345 # boolean 346 "--hwvirt") TESTBOXSCRIPT_HWVIRT="yes";; 347 "--no-hwvirt") TESTBOXSCRIPT_HWVIRT="no";; 348 "--nested-paging") TESTBOXSCRIPT_NESTED_PAGING="yes";; 349 "--no-nested-paging") TESTBOXSCRIPT_NESTED_PAGING="no";; 350 "--io-mmu") TESTBOXSCRIPT_IOMMU="yes";; 351 "--no-io-mmu") TESTBOXSCRIPT_IOMMU="no";; 352 # optios taking values. 353 "--system-uuid") TESTBOXSCRIPT_SYSTEM_UUID="$2"; shift;; 354 "--scratch-root") TESTBOXSCRIPT_SCRATCH_ROOT="$2"; shift;; 355 "--test-manager") TESTBOXSCRIPT_TEST_MANAGER="$2"; shift;; 356 "--builds-path") TESTBOXSCRIPT_BUILDS_PATH="$2"; shift;; 357 "--builds-server-type") TESTBOXSCRIPT_BUILDS_TYPE="$2"; shift;; 358 "--builds-server-name") TESTBOXSCRIPT_BUILDS_NAME="$2"; shift;; 359 "--builds-server-share") TESTBOXSCRIPT_BUILDS_SHARE="$2"; shift;; 360 "--builds-server-user") TESTBOXSCRIPT_BUILDS_USER="$2"; shift;; 361 "--builds-server-passwd") TESTBOXSCRIPT_BUILDS_PASSWD="$2"; shift;; 362 "--testrsrc-path") TESTBOXSCRIPT_TESTRSRC_PATH="$2"; shift;; 363 "--testrsrc-server-type") TESTBOXSCRIPT_TESTRSRC_TYPE="$2"; shift;; 364 "--testrsrc-server-name") TESTBOXSCRIPT_TESTRSRC_NAME="$2"; shift;; 365 "--testrsrc-server-share") TESTBOXSCRIPT_TESTRSRC_SHARE="$2"; shift;; 366 "--testrsrc-server-user") TESTBOXSCRIPT_TESTRSRC_USER="$2"; shift;; 367 "--testrsrc-server-passwd") TESTBOXSCRIPT_TESTRSRC_PASSWD="$2"; shift;; 368 "--putenv") 369 ## @todo remove any existing variable or we'll end up with a pretty long number of putenv statements on solaris. 370 TESTBOXSCRIPT_ENVVARS+=("$2"); 371 shift;; 372 --*) 373 echo "error: Unknown option '$1' in existing config" 374 exit 1 375 ;; 376 377 # Non-option bits. 378 *.py) ;; # ignored, should be the script. 379 380 *) if [ ${MY_ARG} -ne 0 ]; then 381 echo "error: unknown non-option '$1' in existing config" 382 exit 1 383 fi 384 TESTBOXSCRIPT_PYTHON="$1" 385 ;; 386 esac 387 shift 388 MY_ARG=$((${MY_ARG} + 1)) 389 done 390 } 391 392 ## 393 # Used by common_compile_testboxscript_command_line, please override. 394 # 395 os_add_args() { 396 echo "os_add_args is not implemented" 2>&1 397 exit 1 398 } 399 400 ## 401 # Compiles the testboxscript.py command line given the current 402 # configuration and defaults. 403 # 404 # This is used by solaris and darwin. 405 # 406 # The os_add_args function will be called several with one or two arguments 407 # each time. The caller must override it. 408 # 409 common_compile_testboxscript_command_line() { 410 if [ -n "${TESTBOXSCRIPT_PYTHON}" ]; then 411 os_add_args "${TESTBOXSCRIPT_PYTHON}" 412 fi 413 os_add_args "${TESTBOXSCRIPT_DIR}/testboxscript/testboxscript.py" 414 415 for var in ${TESTBOXSCRIPT_CFG_NAMES}; 416 do 417 varcfg=TESTBOXSCRIPT_${var} 418 vardef=TESTBOXSCRIPT_DEFAULT_${var} 419 if [ "${!varcfg}" != "${!vardef}" -a "${var}" != "PYTHON" ]; then # PYTHON handled above. 420 my_opt=TESTBOXSCRIPT_OPT_${var} 421 if [ -n "${!my_opt}" ]; then 422 if [ "${!my_opt}" != "--skip" ]; then 423 os_add_args "${!my_opt}" "${!varcfg}" 424 fi 425 else 426 my_opt_yes=${my_opt}_YES 427 my_opt_no=${my_opt}_NO 428 if [ -n "${!my_opt_yes}" -a -n "${!my_opt_no}" ]; then 429 if [ "${!varcfg}" = "yes" ]; then 430 os_add_args "${!my_opt_yes}"; 431 else 432 if [ "${!varcfg}" != "no" ]; then 433 echo "internal option misconfig: var=${var} not a yes/no value: ${!varcfg}"; 434 exit 1; 435 fi 436 os_add_args "${!my_opt_yes}"; 437 fi 438 else 439 echo "internal option misconfig: var=${var} my_opt_yes=${my_opt_yes}=${!my_opt_yes} my_opt_no=${my_opt_no}=${!my_opt_no}" 440 exit 1; 441 fi 442 fi 443 fi 444 done 445 446 i=0 447 while [ "${i}" -lt "${#TESTBOXSCRIPT_ENVVARS[@]}" ]; 448 do 449 os_add_args "--putenv" "${TESTBOXSCRIPT_ENVVARS[${i}]}" 450 i=$((${i} + 1)) 451 done 452 } 453 336 454 337 455 # … … 361 479 # Config. 362 480 # 363 TESTBOXSCRIPT_PYTHON="" 364 TESTBOXSCRIPT_USER="" 365 TESTBOXSCRIPT_HWVIRT="" 366 TESTBOXSCRIPT_IOMMU="" 367 TESTBOXSCRIPT_NESTED_PAGING="" 368 TESTBOXSCRIPT_SYSTEM_UUID="" 369 TESTBOXSCRIPT_PATH_TESTRSRC="" 370 TESTBOXSCRIPT_TEST_MANAGER="" 371 TESTBOXSCRIPT_SCRATCH_ROOT="" 372 TESTBOXSCRIPT_BUILDS_PATH="" 373 TESTBOXSCRIPT_BUILDS_TYPE="cifs" 374 TESTBOXSCRIPT_BUILDS_NAME="vboxstor.de.oracle.com" 375 TESTBOXSCRIPT_BUILDS_SHARE="builds" 376 TESTBOXSCRIPT_BUILDS_USER="guestr" 377 TESTBOXSCRIPT_BUILDS_PASSWD="guestr" 378 TESTBOXSCRIPT_TESTRSRC_PATH="" 379 TESTBOXSCRIPT_TESTRSRC_TYPE="cifs" 380 TESTBOXSCRIPT_TESTRSRC_NAME="teststor.de.oracle.com" 381 TESTBOXSCRIPT_TESTRSRC_SHARE="testrsrc" 382 TESTBOXSCRIPT_TESTRSRC_USER="guestr" 383 TESTBOXSCRIPT_TESTRSRC_PASSWD="guestr" 481 TESTBOXSCRIPT_CFG_NAMES="DIR PYTHON USER HWVIRT IOMMU NESTED_PAGING SYSTEM_UUID PATH_TESTRSRC TEST_MANAGER SCRATCH_ROOT" 482 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} BUILDS_PATH BUILDS_TYPE BUILDS_NAME BUILDS_SHARE BUILDS_USER BUILDS_PASSWD" 483 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} TESTRSRC_PATH TESTRSRC_TYPE TESTRSRC_NAME TESTRSRC_SHARE TESTRSRC_USER TESTRSRC_PASSWD" 484 485 # testboxscript.py option to config mappings. 486 TESTBOXSCRIPT_OPT_DIR="--skip" 487 TESTBOXSCRIPT_OPT_PYTHON="--skip" 488 TESTBOXSCRIPT_OPT_USER="--skip" 489 TESTBOXSCRIPT_OPT_HWVIRT_YES="--hwvirt" 490 TESTBOXSCRIPT_OPT_HWVIRT_NO="--no-hwvirt" 491 TESTBOXSCRIPT_OPT_NESTED_PAGING_YES="--nested-paging" 492 TESTBOXSCRIPT_OPT_NESTED_PAGING_NO="--no-nested-paging" 493 TESTBOXSCRIPT_OPT_IOMMU_YES="--io-mmu" 494 TESTBOXSCRIPT_OPT_IOMMU_NO="--no-io-mmu" 495 TESTBOXSCRIPT_OPT_SYSTEM_UUID="--system-uuid" 496 TESTBOXSCRIPT_OPT_TEST_MANAGER="--test-manager" 497 TESTBOXSCRIPT_OPT_SCRATCH_ROOT="--scratch-root" 498 TESTBOXSCRIPT_OPT_BUILDS_PATH="--builds-path" 499 TESTBOXSCRIPT_OPT_BUILDS_TYPE="--builds-server-type" 500 TESTBOXSCRIPT_OPT_BUILDS_NAME="--builds-server-name" 501 TESTBOXSCRIPT_OPT_BUILDS_SHARE="--builds-server-share" 502 TESTBOXSCRIPT_OPT_BUILDS_USER="--builds-server-user" 503 TESTBOXSCRIPT_OPT_BUILDS_PASSWD="--builds-server-passwd" 504 TESTBOXSCRIPT_OPT_PATH_TESTRSRC="--testrsrc-path" 505 TESTBOXSCRIPT_OPT_TESTRSRC_TYPE="--testrsrc-server-type" 506 TESTBOXSCRIPT_OPT_TESTRSRC_NAME="--testrsrc-server-name" 507 TESTBOXSCRIPT_OPT_TESTRSRC_SHARE="--testrsrc-server-share" 508 TESTBOXSCRIPT_OPT_TESTRSRC_USER="--testrsrc-server-user" 509 TESTBOXSCRIPT_OPT_TESTRSRC_PASSWD="--testrsrc-server-passwd" 510 511 # Defaults: 512 TESTBOXSCRIPT_DEFAULT_DIR="there-is-no-default-for-this-value" 513 TESTBOXSCRIPT_DEFAULT_PYTHON="" 514 TESTBOXSCRIPT_DEFAULT_USER="vbox" 515 TESTBOXSCRIPT_DEFAULT_HWVIRT="" 516 TESTBOXSCRIPT_DEFAULT_IOMMU="" 517 TESTBOXSCRIPT_DEFAULT_NESTED_PAGING="" 518 TESTBOXSCRIPT_DEFAULT_SYSTEM_UUID="" 519 TESTBOXSCRIPT_DEFAULT_PATH_TESTRSRC="" 520 TESTBOXSCRIPT_DEFAULT_TEST_MANAGER="" 521 TESTBOXSCRIPT_DEFAULT_SCRATCH_ROOT="" 522 TESTBOXSCRIPT_DEFAULT_BUILDS_PATH="" 523 TESTBOXSCRIPT_DEFAULT_BUILDS_TYPE="cifs" 524 TESTBOXSCRIPT_DEFAULT_BUILDS_NAME="vboxstor.de.oracle.com" 525 TESTBOXSCRIPT_DEFAULT_BUILDS_SHARE="builds" 526 TESTBOXSCRIPT_DEFAULT_BUILDS_USER="guestr" 527 TESTBOXSCRIPT_DEFAULT_BUILDS_PASSWD="guestr" 528 TESTBOXSCRIPT_DEFAULT_TESTRSRC_PATH="" 529 TESTBOXSCRIPT_DEFAULT_TESTRSRC_TYPE="cifs" 530 TESTBOXSCRIPT_DEFAULT_TESTRSRC_NAME="teststor.de.oracle.com" 531 TESTBOXSCRIPT_DEFAULT_TESTRSRC_SHARE="testrsrc" 532 TESTBOXSCRIPT_DEFAULT_TESTRSRC_USER="guestr" 533 TESTBOXSCRIPT_DEFAULT_TESTRSRC_PASSWD="guestr" 534 535 # Set config values to defaults. 536 for var in ${TESTBOXSCRIPT_CFG_NAMES} 537 do 538 defvar=TESTBOXSCRIPT_DEFAULT_${var} 539 eval TESTBOXSCRIPT_${var}="${!defvar}" 540 done 384 541 declare -a TESTBOXSCRIPT_ENVVARS 385 542 … … 387 544 os_load_config 388 545 389 # Set defaults. 546 547 # 548 # Config tweaks. 549 # 550 551 # The USER must be a non-empty value for the successful execution of this script. 390 552 if [ -z "${TESTBOXSCRIPT_USER}" ]; then 391 TESTBOXSCRIPT_USER= vbox;553 TESTBOXSCRIPT_USER=${TESTBOXSCRIPT_DEFAULT_USER}; 392 554 fi; 555 556 # The DIR must be according to the setup.sh location. 393 557 TESTBOXSCRIPT_DIR=`dirname "${DIR}"` 558 559 # Storage server replacement trick. 560 if [ "${TESTBOXSCRIPT_BUILDS_NAME}" = "solserv.de.oracle.com" ]; then 561 TESTBOXSCRIPT_BUILDS_NAME=${TESTBOXSCRIPT_DEFAULT_BUILDS_NAME} 562 fi 563 if [ "${TESTBOXSCRIPT_TESTRSRC_NAME}" = "solserv.de.oracle.com" ]; then 564 TESTBOXSCRIPT_TESTRSRC_NAME=${TESTBOXSCRIPT_DEFAULT_TESTRSRC_NAME} 565 fi 394 566 395 567 -
trunk/src/VBox/ValidationKit/testboxscript/solaris/setup-routines.sh
r56295 r66800 5 5 6 6 # 7 # Copyright (C) 2006-201 5Oracle Corporation7 # Copyright (C) 2006-2017 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 81 81 82 82 ## 83 # Checks for a boolean option pair --$2/--no-$2 in the XMLARGS variable,84 # storing the result in the TESTBOXSCRIPT_XXX variable $1.85 solaris_check_for_option_bool() {86 MY_TMP=`echo "${XMLARGS} " | ${MY_SED} -ne "s/^.*[ \"]--$2[ \"].*\$/yes/p"`87 if [ -n "${MY_TMP}" ]; then88 eval $1="yes";89 fi90 MY_TMP=`echo "${XMLARGS} " | ${MY_SED} -ne "s/^.*[ \"]--no-$2[ \"].*\$/yes/p"`91 if [ -n "${MY_TMP}" ]; then92 eval $1="no";93 fi94 return 0;95 }96 97 ##98 # Checks for an option $2 taking an argument, storing the result in the99 # TESTBOXSCRIPT_XXX variable $1.100 solaris_check_for_option_arg() {101 # ASSUMES no quoted option values nor any escaped spaces.102 MY_TMP=`echo "${XMLARGS} " | ${MY_SED} -ne "s/^.*[ \"]--$2 *\([^ \"]*\)[ \"].*\$/\1/p"`103 if [ -n "${MY_TMP}" ]; then104 eval $1="\"${MY_TMP}\"";105 fi106 return 0;107 }108 109 ##110 83 # Loads config values from the current installation. 111 84 # … … 120 93 TESTBOXSCRIPT_BUILDS_TYPE="nfs" 121 94 TESTBOXSCRIPT_TESTRSRC_TYPE="nfs" 95 TESTBOXSCRIPT_DEFAULT_BUILDS_TYPE="nfs" 96 TESTBOXSCRIPT_DEFAULT_TESTRSRC_TYPE="nfs" 122 97 TESTBOXSCRIPT_ENVVARS[${#TESTBOXSCRIPT_ENVVARS[@]}]="PATH=${PATH}"; 123 98 … … 153 128 -e 's/>/>/g' \ 154 129 -e 's/&/&/g' \ 130 | ${MY_SED} \ 131 -e 's/^.*testboxscript -d -m *//' \ 155 132 `; 156 157 solaris_check_for_option_arg TESTBOXSCRIPT_SYSTEM_UUID system-uuid 158 solaris_check_for_option_arg TESTBOXSCRIPT_SCRATCH_ROOT scratch-root 159 solaris_check_for_option_arg TESTBOXSCRIPT_TEST_MANAGER test-manager 160 solaris_check_for_option_bool TESTBOXSCRIPT_HWVIRT hwvirt 161 solaris_check_for_option_bool TESTBOXSCRIPT_NESTED_PAGING nested-paging 162 solaris_check_for_option_bool TESTBOXSCRIPT_IOMMU io-mmu 163 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_PATH builds-path 164 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_TYPE builds-server-type 165 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_NAME builds-server-name 166 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_SHARE builds-server-share 167 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_USER builds-server-user 168 solaris_check_for_option_arg TESTBOXSCRIPT_BUILDS_PASSWD builds-server-passwd 169 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_PATH testrsrc-path 170 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_TYPE testrsrc-server-type 171 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_NAME testrsrc-server-name 172 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_SHARE testrsrc-server-share 173 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_USER testrsrc-server-user 174 solaris_check_for_option_arg TESTBOXSCRIPT_TESTRSRC_PASSWD testrsrc-server-passwd 175 176 ## @TODO solaris_check_for_option_arg TESTBOXSCRIPT_PYTHON python 177 ## @TODO solaris_check_for_option_arg TESTBOXSCRIPT_ENVVARS putenv - Multiple occurences possible. 133 eval common_testboxscript_args_to_config `echo "${XMLARGS}" | sed -e "s/<string>/'/g" -e "s/<\/string>/'/g" `; 178 134 fi 179 135 } … … 182 138 # Adds one or more arguments to MY_ARGV after checking them for conformity. 183 139 # 184 solaris_add_args() {140 os_add_args() { 185 141 while [ $# -gt 0 ]; 186 142 do … … 229 185 # Calc the command line. 230 186 MY_ARGV="" 231 if [ -n "${TESTBOXSCRIPT_PYTHON}" ]; then 232 solaris_add_args "${TESTBOXSCRIPT_PYTHON}" 233 fi 234 solaris_add_args "${TESTBOXSCRIPT_DIR}/testboxscript/testboxscript.py" 235 236 if [ "${TESTBOXSCRIPT_HWVIRT}" = "yes" ]; then solaris_add_args "--hwvirt"; fi 237 if [ "${TESTBOXSCRIPT_HWVIRT}" = "no" ]; then solaris_add_args "--no-hwvirt"; fi 238 if [ "${TESTBOXSCRIPT_NESTED_PAGING}" = "yes" ]; then solaris_add_args "--nested-paging"; fi 239 if [ "${TESTBOXSCRIPT_NESTED_PAGING}" = "no" ]; then solaris_add_args "--no-nested-paging"; fi 240 if [ "${TESTBOXSCRIPT_IOMMU}" = "yes" ]; then solaris_add_args "--io-mmu"; fi 241 if [ "${TESTBOXSCRIPT_IOMMU}" = "no" ]; then solaris_add_args "--no-io-mmu"; fi 242 if [ -n "${TESTBOXSCRIPT_SYSTEM_UUID}" ]; then solaris_add_args "--system-uuid" "${TESTBOXSCRIPT_SYSTEM_UUID}"; fi 243 if [ -n "${TESTBOXSCRIPT_TEST_MANAGER}" ]; then solaris_add_args "--test-manager" "${TESTBOXSCRIPT_TEST_MANAGER}"; fi 244 if [ -n "${TESTBOXSCRIPT_SCRATCH_ROOT}" ]; then solaris_add_args "--scratch-root" "${TESTBOXSCRIPT_SCRATCH_ROOT}"; fi 245 246 if [ -n "${TESTBOXSCRIPT_BUILDS_PATH}" ]; then solaris_add_args "--builds-path" "${TESTBOXSCRIPT_BUILDS_PATH}"; fi 247 if [ -n "${TESTBOXSCRIPT_BUILDS_TYPE}" ]; then solaris_add_args "--builds-server-type" "${TESTBOXSCRIPT_BUILDS_TYPE}"; fi 248 if [ -n "${TESTBOXSCRIPT_BUILDS_NAME}" ]; then solaris_add_args "--builds-server-name" "${TESTBOXSCRIPT_BUILDS_NAME}"; fi 249 if [ -n "${TESTBOXSCRIPT_BUILDS_SHARE}" ]; then solaris_add_args "--builds-server-share" "${TESTBOXSCRIPT_BUILDS_SHARE}"; fi 250 if [ -n "${TESTBOXSCRIPT_BUILDS_USER}" ]; then solaris_add_args "--builds-server-user" "${TESTBOXSCRIPT_BUILDS_USER}"; fi 251 if [ -n "${TESTBOXSCRIPT_BUILDS_PASSWD}" ]; then solaris_add_args "--builds-server-passwd" "${TESTBOXSCRIPT_BUILDS_PASSWD}"; fi 252 if [ -n "${TESTBOXSCRIPT_TESTRSRC_PATH}" ]; then solaris_add_args "--testrsrc-path" "${TESTBOXSCRIPT_PATH_TESTRSRC}"; fi 253 if [ -n "${TESTBOXSCRIPT_TESTRSRC_TYPE}" ]; then solaris_add_args "--testrsrc-server-type" "${TESTBOXSCRIPT_TESTRSRC_TYPE}"; fi 254 if [ -n "${TESTBOXSCRIPT_TESTRSRC_NAME}" ]; then solaris_add_args "--testrsrc-server-name" "${TESTBOXSCRIPT_TESTRSRC_NAME}"; fi 255 if [ -n "${TESTBOXSCRIPT_TESTRSRC_SHARE}" ]; then solaris_add_args "--testrsrc-server-share" "${TESTBOXSCRIPT_TESTRSRC_SHARE}"; fi 256 if [ -n "${TESTBOXSCRIPT_TESTRSRC_USER}" ]; then solaris_add_args "--testrsrc-server-user" "${TESTBOXSCRIPT_TESTRSRC_USER}"; fi 257 if [ -n "${TESTBOXSCRIPT_TESTRSRC_PASSWD}" ]; then solaris_add_args "--testrsrc-server-passwd" "${TESTBOXSCRIPT_TESTRSRC_PASSWD}"; fi 258 i=0 259 while [ "${i}" -lt "${#TESTBOXSCRIPT_ENVVARS[@]}" ]; 260 do 261 solaris_add_args "--putenv" "${TESTBOXSCRIPT_ENVVARS[${i}]}" 262 i=$((${i} + 1)) 263 done 187 common_compile_testboxscript_command_line 264 188 265 189 # Create the service xml config file. -
trunk/src/VBox/ValidationKit/testboxscript/testboxscript_real.py
r66798 r66800 905 905 # Parse arguments. 906 906 # 907 sDefShareType = 'nfs' utils.getHostOs() == 'solaris' else 'cifs'; 907 908 if utils.getHostOs() in ('win', 'os2'): 908 sDefTestRsrc = 'T:';909 sDefBuilds = 'U:';909 sDefTestRsrc = 'T:'; 910 sDefBuilds = 'U:'; 910 911 elif utils.getHostOs() == 'darwin': 911 sDefTestRsrc = '/Volumes/testrsrc';912 sDefBuilds = '/Volumes/builds';912 sDefTestRsrc = '/Volumes/testrsrc'; 913 sDefBuilds = '/Volumes/builds'; 913 914 else: 914 sDefTestRsrc = '/mnt/testrsrc';915 sDefBuilds = '/mnt/builds';915 sDefTestRsrc = '/mnt/testrsrc'; 916 sDefBuilds = '/mnt/builds'; 916 917 917 918 class MyOptionParser(OptionParser): … … 930 931 help='Where ' + sDesc + ' can be found'); 931 932 parser.add_option('--' + sLower + '-server-type', 932 dest=sPrefix + 'ServerType', metavar='<nfs|cifs>', default= None,933 help='The type of server, cifs or nfs. If empty (default), we won\'t try mount anything.');933 dest=sPrefix + 'ServerType', metavar='<nfs|cifs>', default=sDefShareType, 934 help='The type of server, cifs (default) or nfs. If empty, we won\'t try mount anything.'); 934 935 parser.add_option('--' + sLower + '-server-name', 935 936 dest=sPrefix + 'ServerName', metavar='<server>',
Note:
See TracChangeset
for help on using the changeset viewer.