-v ${portmappingfile}:/root/port-mapping.yaml ${hostfilemount} opensourcemano/tests:${tagName} \
-c -t ${testName}""")
} finally {
- sh("cp ${tempdir}/* .")
+ sh("cp ${tempdir}/*.xml .")
+ sh("cp ${tempdir}/*.html .")
outputDirectory = sh(returnStdout: true, script: 'pwd').trim()
println("Present Directory is : ${outputDirectory}")
step([
sshCommand remote: remote, command: '''ls -al logs'''
sshGet remote: remote, from: 'logs', into: '.', override: true
sh 'cp logs/* .'
- sshGet remote: remote, from: 'ens3.pcap', into: 'ens3.pcap', override: true
- archiveArtifacts artifacts: '*.log, *.pcap'
+ archiveArtifacts artifacts: '*.log'
}
String get_value(String key, String output) {
///////////////////////////////////////////////////////////////////////////////////////
stage('Copy Artifacts') {
// cleanup any previous repo
- sh 'rm -rf repo'
+ sh "tree -fD repo || exit 0"
+ sh 'rm -rvf repo'
+ sh "tree -fD repo && lsof repo || exit 0"
dir('repo') {
packageList = []
dir("${RELEASE}") {
parallelSteps = [:]
list = ['RO', 'osmclient', 'IM', 'devops', 'MON', 'N2VC', 'NBI',
- 'common', 'LCM', 'POL', 'NG-UI', 'PLA', 'tests']
+ 'common', 'LCM', 'POL', 'NG-UI', 'NG-SA', 'PLA', 'tests']
if (upstreamComponent.length() > 0) {
println("Skipping upstream fetch of ${upstreamComponent}")
list.remove(upstreamComponent)
ci_helper.check_status_http_server(NODE_IP_ADDRESS, repo_port)
}
+ sh "tree -fD repo"
+
// Unpack devops package into temporary location so that we use it from upstream if it was part of a patch
osm_devops_dpkg = sh(returnStdout: true, script: 'find ./repo/release/pool/ -name osm-devops*.deb').trim()
devopstempdir = sh(returnStdout: true, script: 'mktemp -d').trim()
pty: true
]
+ // Ensure the VM is ready
+ sshCommand remote: remote, command: 'cloud-init status --wait'
// Force time sync to avoid clock drift and invalid certificates
- sshCommand remote: remote, command: 'nohup sudo tcpdump -i ens3 -w ens3.pcap -s 400 & sleep 5'
sshCommand remote: remote, command: 'sudo apt-get update'
sshCommand remote: remote, command: 'sudo apt-get install -y chrony'
sshCommand remote: remote, command: 'sudo service chrony stop'
]
sshCommand remote: remote, command: '''
- wget https://osm-download.etsi.org/ftp/osm-11.0-eleven/install_osm.sh
+ wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh
chmod +x ./install_osm.sh
sed -i '1 i\\export PATH=/snap/bin:\$PATH' ~/.bashrc
'''
prometheusPort = 9091
osmHostname = IP_ADDRESS
}
- sshCommand remote: remote, command: """
- sudo killall tcpdump
- """
-
} // stage("Install")
///////////////////////////////////////////////////////////////////////////////////////
// Health check of installed OSM in remote vm
if ( params.DO_ROBOT ) {
try {
stage('System Integration Test') {
-
if (useCharmedInstaller) {
tempdir = sh(returnStdout: true, script: 'mktemp -d').trim()
sh(script: "touch ${tempdir}/hosts")
parallelSteps[module] = {
dir("$module") {
- sh("""docker tag opensourcemano/${moduleName}:${moduleTag} \
+ sh("docker pull ${INTERNAL_DOCKER_REGISTRY}opensourcemano/${moduleName}:${moduleTag}")
+ sh("""docker tag ${INTERNAL_DOCKER_REGISTRY}opensourcemano/${moduleName}:${moduleTag} \
opensourcemano/${moduleName}:${dockerTag}""")
sh "docker push opensourcemano/${moduleName}:${dockerTag}"
}
}
parallel parallelSteps
}
-
stage('Snap promotion') {
withCredentials([string(credentialsId: 'Snapstore', variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
snaps = ['osmclient']
edge_rev = sh(returnStdout: true,
script: "snapcraft revisions $snap | " +
"grep \"$track\" | tail -1 | awk '{print \$1}'").trim()
- print "edge rev is $edge_rev"
track = channel + 'beta\\*'
beta_rev = sh(returnStdout: true,
script: "snapcraft revisions $snap | " +
"grep \"$track\" | tail -1 | awk '{print \$1}'").trim()
- print "beta rev is $beta_rev"
+
+ print "Edge: $edge_rev, Beta: $beta_rev"
if (edge_rev != beta_rev) {
print "Promoting $edge_rev to beta in place of $beta_rev"
} finally {
stage('Archive Container Logs') {
if ( ARCHIVE_LOGS_FLAG ) {
- // Archive logs
- remote = [
- name: containerName,
- host: IP_ADDRESS,
- user: 'ubuntu',
- identityFile: SSH_KEY,
- allowAnyHosts: true,
- logLevel: 'INFO',
- pty: true
- ]
- println('Archiving container logs')
- archive_logs(remote)
+ try {
+ // Archive logs
+ remote = [
+ name: containerName,
+ host: IP_ADDRESS,
+ user: 'ubuntu',
+ identityFile: SSH_KEY,
+ allowAnyHosts: true,
+ logLevel: 'INFO',
+ pty: true
+ ]
+ println('Archiving container logs')
+ archive_logs(remote)
+ } catch (Exception e) {
+ println('Error fetching logs: '+ e.getMessage())
+ }
} // end if ( ARCHIVE_LOGS_FLAG )
}
stage('Cleanup') {