Changeset 72259 in vbox for trunk/src/VBox/ValidationKit/testboxscript
- Timestamp:
- May 18, 2018 10:22:17 AM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testboxscript
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/setup.sh
r67192 r72259 367 367 "--builds-server-user") TESTBOXSCRIPT_BUILDS_USER="$2"; shift;; 368 368 "--builds-server-passwd") TESTBOXSCRIPT_BUILDS_PASSWD="$2"; shift;; 369 "--builds-server-mountopt") TESTBOXSCRIPT_BUILDS_MOUNTOPT="$2"; shift;; 369 370 "--testrsrc-path") TESTBOXSCRIPT_TESTRSRC_PATH="$2"; shift;; 370 371 "--testrsrc-server-type") TESTBOXSCRIPT_TESTRSRC_TYPE="$2"; shift;; … … 373 374 "--testrsrc-server-user") TESTBOXSCRIPT_TESTRSRC_USER="$2"; shift;; 374 375 "--testrsrc-server-passwd") TESTBOXSCRIPT_TESTRSRC_PASSWD="$2"; shift;; 376 "--testrsrc-server-mountopt") TESTBOXSCRIPT_TESTRSRC_MOUNTOPT="$2"; shift;; 375 377 "--putenv") 376 378 MY_FOUND=no … … 498 500 # 499 501 TESTBOXSCRIPT_CFG_NAMES="DIR PYTHON USER HWVIRT IOMMU NESTED_PAGING SYSTEM_UUID PATH_TESTRSRC TEST_MANAGER SCRATCH_ROOT" 500 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} BUILDS_PATH BUILDS_TYPE BUILDS_NAME BUILDS_SHARE BUILDS_USER BUILDS_PASSWD "501 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} TESTRSRC_PATH TESTRSRC_TYPE TESTRSRC_NAME TESTRSRC_SHARE TESTRSRC_USER TESTRSRC_PASSWD "502 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} BUILDS_PATH BUILDS_TYPE BUILDS_NAME BUILDS_SHARE BUILDS_USER BUILDS_PASSWD BUILDS_MOUNTOPT" 503 TESTBOXSCRIPT_CFG_NAMES="${TESTBOXSCRIPT_CFG_NAMES} TESTRSRC_PATH TESTRSRC_TYPE TESTRSRC_NAME TESTRSRC_SHARE TESTRSRC_USER TESTRSRC_PASSWD TESTRSRC_MOUNTOPT" 502 504 503 505 # testboxscript.py option to config mappings. … … 520 522 TESTBOXSCRIPT_OPT_BUILDS_USER="--builds-server-user" 521 523 TESTBOXSCRIPT_OPT_BUILDS_PASSWD="--builds-server-passwd" 524 TESTBOXSCRIPT_OPT_BUILDS_MOUNTOPT="--builds-server-mountopt" 522 525 TESTBOXSCRIPT_OPT_PATH_TESTRSRC="--testrsrc-path" 523 526 TESTBOXSCRIPT_OPT_TESTRSRC_TYPE="--testrsrc-server-type" … … 526 529 TESTBOXSCRIPT_OPT_TESTRSRC_USER="--testrsrc-server-user" 527 530 TESTBOXSCRIPT_OPT_TESTRSRC_PASSWD="--testrsrc-server-passwd" 531 TESTBOXSCRIPT_OPT_TESTRSRC_MOUNTOPT="--testrsrc-server-mountopt" 528 532 529 533 # Defaults: … … 544 548 TESTBOXSCRIPT_DEFAULT_BUILDS_USER="guestr" 545 549 TESTBOXSCRIPT_DEFAULT_BUILDS_PASSWD="guestr" 550 TESTBOXSCRIPT_DEFAULT_BUILDS_MOUNTOPT="" 546 551 TESTBOXSCRIPT_DEFAULT_TESTRSRC_PATH="" 547 552 TESTBOXSCRIPT_DEFAULT_TESTRSRC_TYPE="cifs" … … 550 555 TESTBOXSCRIPT_DEFAULT_TESTRSRC_USER="guestr" 551 556 TESTBOXSCRIPT_DEFAULT_TESTRSRC_PASSWD="guestr" 557 TESTBOXSCRIPT_DEFAULT_TESTRSRC_MOUNTOPT="" 552 558 553 559 # Set config values to defaults. … … 620 626 --builds-server-user) TESTBOXSCRIPT_BUILDS_USER="$2"; shift;; 621 627 --builds-server-passwd) TESTBOXSCRIPT_BUILDS_PASSWD="$2"; shift;; 628 --builds-server-mountopt) TESTBOXSCRIPT_BUILDS_MOUNTOPT="$2"; shift;; 622 629 --testrsrc-path) TESTBOXSCRIPT_TESTRSRC_PATH="$2"; shift;; 623 630 --testrsrc-server-type) TESTBOXSCRIPT_TESTRSRC_TYPE="$2"; shift;; … … 626 633 --testrsrc-server-user) TESTBOXSCRIPT_TESTRSRC_USER="$2"; shift;; 627 634 --testrsrc-server-passwd) TESTBOXSCRIPT_TESTRSRC_PASSWD="$2"; shift;; 635 --testrsrc-server-mountopt) TESTBOXSCRIPT_TESTRSRC_MOUNTOPT="$2"; shift;; 628 636 *) 629 637 echo 'Syntax error: Unknown option:' "$1" >&2; -
trunk/src/VBox/ValidationKit/testboxscript/testboxscript_real.py
r70660 r72259 248 248 self._mountShare(self._oOptions.sBuildsPath, self._oOptions.sBuildsServerType, self._oOptions.sBuildsServerName, 249 249 self._oOptions.sBuildsServerShare, 250 self._oOptions.sBuildsServerUser, self._oOptions.sBuildsServerPasswd, 'builds'); 250 self._oOptions.sBuildsServerUser, self._oOptions.sBuildsServerPasswd, 251 self._oOptions.sBuildsServerMountOpt, 'builds'); 251 252 self._mountShare(self._oOptions.sTestRsrcPath, self._oOptions.sTestRsrcServerType, self._oOptions.sTestRsrcServerName, 252 253 self._oOptions.sTestRsrcServerShare, 253 self._oOptions.sTestRsrcServerUser, self._oOptions.sTestRsrcServerPasswd, 'testrsrc'); 254 self._oOptions.sTestRsrcServerUser, self._oOptions.sTestRsrcServerPasswd, 255 self._oOptions.sTestRsrcServerMountOpt, 'testrsrc'); 254 256 return True; 255 257 256 def _mountShare(self, sMountPoint, sType, sServer, sShare, sUser, sPassword, s What):258 def _mountShare(self, sMountPoint, sType, sServer, sShare, sUser, sPassword, sMountOpt, sWhat): 257 259 """ 258 260 Mounts the specified share if needed. … … 273 275 sHostOs = utils.getHostOs() 274 276 if sHostOs in ('darwin', 'freebsd'): 277 if sMountOpt != '': 278 sMountOpt = ',' + sMountOpt 275 279 utils.sudoProcessCall(['/sbin/umount', sMountPoint]); 276 280 utils.sudoProcessCall(['/bin/mkdir', '-p', sMountPoint]); … … 278 282 if sType == 'cifs': 279 283 # Note! no smb://server/share stuff here, 10.6.8 didn't like it. 280 utils.processOutputChecked(['/sbin/mount_smbfs', '-o', 'automounted,nostreams,soft,noowners,noatime,rdonly', 284 utils.processOutputChecked(['/sbin/mount_smbfs', 285 '-o', 286 'automounted,nostreams,soft,noowners,noatime,rdonly' + sMountOpt, 281 287 '-f', '0555', '-d', '0555', 282 288 '//%s:%s@%s/%s' % (sUser, sPassword, sServer, sShare), … … 286 292 287 293 elif sHostOs == 'linux': 294 if sMountOpt != '': 295 sMountOpt = ',' + sMountOpt 288 296 utils.sudoProcessCall(['/bin/umount', sMountPoint]); 289 297 utils.sudoProcessCall(['/bin/mkdir', '-p', sMountPoint]); … … 296 304 + ',uid=' + str(os.getuid()) # pylint: disable=E1101 297 305 + ',gid=' + str(os.getgid()) # pylint: disable=E1101 298 + ',nounix,file_mode=0555,dir_mode=0555,soft,ro', 306 + ',nounix,file_mode=0555,dir_mode=0555,soft,ro' 307 + sMountOpt, 299 308 '//%s/%s' % (sServer, sShare), 300 309 sMountPoint]); 301 310 elif sType == 'nfs': 302 311 utils.sudoProcessOutputChecked(['/bin/mount', '-t', 'nfs', 303 '-o', 'soft,ro' ,312 '-o', 'soft,ro' + sMountOpt, 304 313 '%s:%s' % (sServer, sShare if sShare.find('/') >= 0 else ('/export/' + sShare)), 305 314 sMountPoint]); … … 309 318 310 319 elif sHostOs == 'solaris': 320 if sMountOpt != '': 321 sMountOpt = ',' + sMountOpt 311 322 utils.sudoProcessCall(['/sbin/umount', sMountPoint]); 312 323 utils.sudoProcessCall(['/bin/mkdir', '-p', sMountPoint]); … … 321 332 + ',uid=' + str(os.getuid()) # pylint: disable=E1101 322 333 + ',gid=' + str(os.getgid()) # pylint: disable=E1101 323 + ',fileperms=0555,dirperms=0555,noxattr,ro', 334 + ',fileperms=0555,dirperms=0555,noxattr,ro' 335 + sMountOpt, 324 336 '//%s/%s' % (sServer, sShare), 325 337 sMountPoint], … … 328 340 elif sType == 'nfs': 329 341 utils.sudoProcessOutputChecked(['/sbin/mount', '-F', 'nfs', 330 '-o', 'noxattr,ro' ,342 '-o', 'noxattr,ro' + sMountOpt, 331 343 '%s:%s' % (sServer, sShare if sShare.find('/') >= 0 else ('/export/' + sShare)), 332 344 sMountPoint]); … … 950 962 dest=sPrefix + 'ServerPasswd', metavar='<password>', default='guestr', 951 963 help='The password to use when accessing the ' + sDesc + ' share.'); 964 parser.add_option('--' + sLower + '-server-mountopt', 965 dest=sPrefix + 'ServerMountOpt', metavar='<mountopt>', default='', 966 help='The mount options to use when accessing the ' + sDesc + ' share.'); 952 967 953 968 parser.add_option("--test-manager", metavar="<url>",
Note:
See TracChangeset
for help on using the changeset viewer.