This function creates a default webcontainer instance
Location of target host
Pathname to installation root
'Copy webcontainer %s to host %s' % (WC_ZIPNAME,location)
{ 'location' : STAXServiceMachine,
'srcfile' : '%s/%s' % (WC_ZIPPATH,WC_ZIPNAME),
'destfile' : '%s/%s' % (wcPath,WC_ZIPNAME),
'remotehost' : mylocation
}
'Extract temporary webcontainer zip archive to %s %s.' % (location, wcPath)
{ 'location' : mylocation,
'zipfile' : '%s/%s' % (wcPath,WC_ZIPNAME),
'unzipdir' : '%s' % wcPath }
{
'location' : STAXServiceMachine,
'entry' : '%s/HttpCertificate' % TMPDIR,
'attribute' : 'TYPE'
}
{ 'name' : 'Generate a Certificate',
'location' : STAXServiceMachine,
'command' : '%s/bin/keytool' % (LOCAL_JAVA_HOME),
'arguments' : '-genkey -alias %s -keyalg rsa \
-dname "cn=%s,O=Sun Microsystems,C=US" \
-keystore "%s/HttpCertificate" \
-storepass "changeit" -keypass "changeit" \
-storetype JKS ' % (WC_TYPE, WC_TYPE, TMPDIR),
'path' : '%s/bin' % (LOCAL_JAVA_HOME),
'expectedRC': 0
}
'copying %s/HttpCertificate to %s/HttpCertificate' % (TMPDIR,wcPath)
{ 'location' : STAXServiceMachine,
'srcfile' : '%s/HttpCertificate' % TMPDIR,
'destfile' : '%s/HttpCertificate' % wcPath,
'remotehost' : mylocation
}
'%s' % mylocation
'fs'
' LIST DIRECTORY %s/apache-%s-%s/bin EXT sh' % \
(wcPath, WC_TYPE, WC_VERSION)
'shFilesResult=%s' % shFilesResult
'%s' % mylocation
'chmod +x %s' % shFilesResult
'%s/apache-%s-%s/bin' % (wcPath, WC_TYPE, WC_VERSION)
['PATH=/bin:/usr/bin']
'Configure webcontainer ports HTTP %s / HTTPS %s' % (WC_PORT, WC_SSL_PORT)
'%s' % mylocation
'fs'
' GET FILE %s/apache-%s-%s/conf/server.xml ' % \
(wcPath, WC_TYPE, WC_VERSION)
{'srcfile' : '%s/%s-apache-%s-%s_server.xml' % (local.temp, STAF_REMOTE_HOSTNAME, WC_TYPE, WC_VERSION),
'destfile' : '%s/apache-%s-%s/conf/server.xml' % (wcPath, WC_TYPE, WC_VERSION),
'remotehost' : '%s' % STAF_REMOTE_HOSTNAME
}
{ 'srcfile' : '%s/../../ext/emma/lib/emma.jar' % TESTS_ROOT,
'destfile' : '%s/apache-%s-%s/lib/emma.jar' % (wcPath, WC_TYPE, WC_VERSION),
'remotehost' : '%s' % STAF_REMOTE_HOSTNAME
}
RC
'Configure webcontainer ports HTTP %s / HTTPS %s' % (WC_PORT, WC_SSL_PORT)
{'srcfile' : '%s/asadminWebContainerConfig' % (local.temp),
'destfile' : '%s/asadminWebContainerConfig' % (remote.temp),
'remotehost' : '%s' % STAF_REMOTE_HOSTNAME
}
RC
'Starting glassfish to enable administration'
'%s' % STAFCmd
{ 'location' : STAF_REMOTE_HOSTNAME,
'command' : STAFCmd,
'envCmd' : STAFCmdEnv,
'arguments' : 'start-domain',
'name' : STAFCmd,
'path' : wcBinPath
}
'Configuring glassfish ports and certificate'
'%s' % STAFCmd
{ 'location' : STAF_REMOTE_HOSTNAME,
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath
}
'failed configuring glassfish with STAXResult=[%s]' % STAXResult
RC
'configure with cfgItem=%s' % cfgItem
{ 'location' : location,
'command' : STAFCmd,
'arguments' : cfgItem,
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath
}
'failed configuring glassfish with STAXResult=[%s]' % STAXResult
RC
'Stopping glassfish '
'%s' % STAFCmd
{ 'location' : location,
'command' : STAFCmd,
'arguments' : 'stop-domain',
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath
}
{
'location' : STAF_REMOTE_HOSTNAME,
'type' : 'system',
'variable' : 'STAF/Env/USER'
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'getting SunWebserver ID',
'command' : STAFCmd,
'arguments' : '--id',
'path' : wcPath,
}
{ 'location' : STAXServiceMachine,
'srcfile' : '%s' % os.path.join(local.temp,silentFilename),
'destfile' : '%s' % silentFilePath,
'remotehost' : STAF_REMOTE_HOSTNAME,
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Setup SunWebserver silent mode',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
'Failed to setup the %s-%s, backing setup log' % (WC_TYPE, WC_VERSION)
{ 'name' : 'backup webapps WEB-INF files',
'location' : STAF_REMOTE_HOSTNAME,
'service' : 'FS',
'request' : 'COPY ',
'arguments' : 'DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcDir, destDir, STAXServiceMachine)
}
'Failed to backup %s-%s setup log file' % (WC_TYPE, WC_VERSION)
0
{ 'location' : STAXServiceMachine,
'srcfile' : '%s' % wadmPwdFilename,
'destfile' : '%s' % wadmDestPwdFilename,
'remotehost' : location}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Migrate the keystore',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Migrate the keystore',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'Create SSL dedicated http-listener',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'set the SSL handling for the SSL dedicated http-listener',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
{ 'location' : STAF_REMOTE_HOSTNAME,
'name' : 'deploy config',
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'path' : wcPath,
}
'backing up the webcontainer config'
{ 'name' : 'backup webcontainers log files',
'location' : STAF_REMOTE_HOSTNAME,
'service' : 'FS',
'request' : 'COPY ',
'arguments' : 'DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcDir, destDir, STAXServiceMachine)
}
'Failed to backup webcontainer log file'
0
'caught %s with %s' % (eType,eInfo)
'Remove temporary webcontainer zip archive from %s %s' % (location,wcPath)
{ 'location' : location ,
'foldername' : '%s' % wcPath }
This function deploys a Web Application War file
Location of target host
Pathname to installation root
Web application war file path
Web application war destination file path
'setup: deploy web application %s to auto deploy webapp directory' % (warFilePath)
'autodeploy directory %s' % destWarFilePath
{ 'location' : STAXServiceMachine,
'srcfile' : '%s' % warFilePath,
'destfile' : '%s' % destWarFilePath,
'remotehost' : location}
This function stops a webcontainer
Location of target host
Pathname to installation root
'%s' % STAFCmd
{ 'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath
}
'backing up the web.xml'
{ 'name' : 'backup webapps WEB-INF files',
'location' : STAF_REMOTE_HOSTNAME,
'service' : 'FS',
'request' : 'COPY ',
'arguments' : 'DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcDir, destDir, STAXServiceMachine)
}
'Failed to backup webcontainer log file'
0
'backing up the webcontainer logs'
{ 'name' : 'backup webcontainers log files',
'location' : STAF_REMOTE_HOSTNAME,
'service' : 'FS',
'request' : 'COPY ',
'arguments' : 'DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcDir, destDir, STAXServiceMachine)
}
'Failed to backup webcontainer log file'
0
This function start a webcontainer
Location of target host
Pathname to installation root
'%s' % STAFCmd
{ 'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath,
'expectedRC' : expectedRC
}
This function removes the webcontainer instance
Location of target host
Pathname to installation root
'Remove webcontainer from %s %s.' % (location,wcPath)
{ 'location' : location,
'foldername' : os.path.join(wcPath,'apache-%s-%s' % (WC_TYPE, WC_VERSION)) }
{ 'location' : location,
'foldername' : os.path.join(wcPath, 'glassfishv3') }
{ 'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdArgs,
'envCmd' : STAFCmdEnv,
'name' : STAFCmd,
'path' : wcBinPath,
'expectedRC' : 0
}
{ 'location' : location,
'foldername' : '%s/%s-%s' % (wcPath, WC_TYPE, WC_VERSION) }
RC
'caught %s with %s' % (eType,eInfo)
'Remove temporary webcontainer zip archive from %s %s' % (location,wcPath)
{ 'location' : location,
'foldername' : os.path.join(wcPath,'apache-%s-%s' % (WC_TYPE, WC_VERSION)) }
{ 'location' : location,
'foldername' : os.path.join(wcPath, 'glassfishv3') }
{ 'location' : location,
'foldername' : '%s/%s-%s' % (wcPath, WC_TYPE, WC_VERSION) }