Update tests for aether pods
- Update test for QA-POD
- SRStaging for testing connecting to Staging pod
- Add some functions for a kubernetes deployed cluster
- Connect to ONOS nodes with kubernetes
- Add option to connect to components through jump hosts
- Fixes for installing ONOS in custom locations
- Invoke python2 instead of python
- If using an ssh agent, also use that for pexpect ssh sessions,
E.G. Jenkins initiated tests
Change-Id: I1fc345c8eab60a5b00c17e6ed677a63489a74a19
diff --git a/TestON/tests/dependencies/utils.py b/TestON/tests/dependencies/utils.py
index 3cf849a..de61ae2 100644
--- a/TestON/tests/dependencies/utils.py
+++ b/TestON/tests/dependencies/utils.py
@@ -73,8 +73,12 @@
stepResult = main.TRUE
scpResult = main.TRUE
copyResult = main.TRUE
+ isKube = False
for ctrl in main.Cluster.runningNodes:
- if ctrl.inDocker:
+ if ctrl.k8s:
+ isKube = True
+ continue
+ elif ctrl.inDocker:
scpResult = scpResult and ctrl.server.dockerCp( ctrl.name,
"/opt/onos/log/karaf.log",
"/tmp/karaf.log",
@@ -97,6 +101,28 @@
stepResult = main.TRUE and stepResult
else:
stepResult = main.FALSE and stepResult
+ if isKube:
+ # TODO: Look into using Stern, kail, or just use `kubectl logs <pod>`
+ # We also need to save the pod name to switch name mapping
+ main.ONOSbench.kubectlPodNodes( dstPath=main.logdir + "/podMapping.txt",
+ kubeconfig=ctrl.k8s.kubeConfig,
+ namespace=main.params[ 'kubernetes' ][ 'namespace' ] )
+ # TODO Get stratum write logs
+ # Save image for pods, based on "describe pods"
+ main.ONOSbench.kubectlDescribe( "pods",
+ main.logdir + "/describePods.txt",
+ kubeconfig=ctrl.k8s.kubeConfig,
+ namespace=main.params[ 'kubernetes' ][ 'namespace' ] )
+ # Get the pod logs
+ pods = main.ONOSbench.kubectlGetPodNames( kubeconfig=ctrl.k8s.kubeConfig,
+ namespace=main.params[ 'kubernetes' ][ 'namespace' ] )
+
+ for pod in pods:
+ path = "%s/%s.log" % ( main.logdir, pod )
+ stratumPods = main.ONOSbench.kubectlLogs( pod,
+ path,
+ kubeconfig=ctrl.k8s.kubeConfig,
+ namespace=main.params[ 'kubernetes' ][ 'namespace' ] )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully copied remote ONOS logs",