[VOL-5121] - Fix permissions on ~/.volt/config
vars/installVoltctl.groovy
--------------------------
o Fix perms on ~/.volt from a central place.
jjb/voltha-e2e/voltha-2.8.yaml
------------------------------
o Cosmetic edit (loglevel: DEBUG <=> INFO).
o Included to force regeneration of pipeline jobs.
Change-Id: Id1db15c01ee4fba949ea1ba1cf41ec01670d17bd
diff --git a/jjb/voltha-e2e/voltha-2.8.yaml b/jjb/voltha-e2e/voltha-2.8.yaml
index b5e8ac2..e511ba5 100644
--- a/jjb/voltha-e2e/voltha-2.8.yaml
+++ b/jjb/voltha-e2e/voltha-2.8.yaml
@@ -20,7 +20,7 @@
make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt
-# source: voltha-e2e.yaml
+ # source: voltha-e2e.yaml
jobs:
- 'voltha-periodic-test':
name: 'periodic-voltha-pm-data-test-bbsim-2.8-playground'
@@ -29,7 +29,7 @@
code-branch: 'voltha-2.8'
extraHelmFlags: '--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
time-trigger: "H H/23 * * *"
- logLevel: 'DEBUG'
+ logLevel: 'INFO'
testTargets: |
- target: voltha-pm-data-single-kind-att
workflow: att
@@ -56,7 +56,7 @@
extraHelmFlags: '--set onu=2,pon=2 --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
olts: 2
timeout: 180
- logLevel: 'DEBUG'
+ logLevel: 'INFO'
testTargets: |
- target: voltha-pm-data-multiolt-kind-att
workflow: att
@@ -136,5 +136,4 @@
teardown: false
logging: true
-
-# [EOF]
+# [EOF]
diff --git a/vars/installVoltctl.groovy b/vars/installVoltctl.groovy
index fb90ebc..55b56c2 100644
--- a/vars/installVoltctl.groovy
+++ b/vars/installVoltctl.groovy
@@ -28,6 +28,35 @@
}
// -----------------------------------------------------------------------
+// Intent: Assign perms to fix access problems
+// . /bin/sh: 1: /home/jenkins/.volt/config: Permission denied
+// -----------------------------------------------------------------------
+def fixPerms() {
+
+ String iam = 'vars/installVoltctl.groovy'
+ println("** ${iam}: ENTER")
+
+ sh(
+ label: 'fixperms',
+ script : """
+
+ umask 022
+
+ volt_dir='~/.volt'
+ volt_cfg='~/.volt/config'
+
+ echo
+ echo "** Fixing perms: $volt_cfg"
+ mkdir -p "$volt_dir"
+ chmod -R u+w,go-rwx "$volt_dir"
+ chmod u=rwx "$volt_dir"
+ touch "$volt_conf"
+ /bin/ls -l "$volt_dir"
+""")
+ return
+}
+
+// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
def process(String branch) {
@@ -37,13 +66,13 @@
// This logic seems odd given we branch & tag repositories
// for release so hilight non-frozen until we know for sure.
def released=[
- // v1.9.1 - https://github.com/opencord/voltctl/releases/tag/untagged-cd611c39178f25b95a87
- 'voltha-2.12' : '1.8.45',
- 'voltha-2.11' : '1.8.45',
- // https://github.com/opencord/voltctl/releases/tag/v1.7.6
- 'voltha-2.10' : '1.7.6',
- 'voltha-2.9' : '1.7.4',
- 'voltha-2.8' : '1.6.11',
+ // v1.9.1 - https://github.com/opencord/voltctl/releases/tag/untagged-cd611c39178f25b95a87
+ 'voltha-2.12' : '1.8.45',
+ 'voltha-2.11' : '1.8.45',
+ // https://github.com/opencord/voltctl/releases/tag/v1.7.6
+ 'voltha-2.10' : '1.7.6',
+ 'voltha-2.9' : '1.7.4',
+ 'voltha-2.8' : '1.6.11',
]
boolean have_released = released.containsKey(branch)
@@ -61,40 +90,40 @@
// Sanity check: released version must be frozen
// ---------------------------------------------
if (is_release && ! released.containsKey(branch)) {
- // Fingers crossed: jenkins may rewrite the callstack.
- def myname = this.class.getName()
+ // Fingers crossed: jenkins may rewrite the callstack.
+ def myname = this.class.getName()
- String url = [
- 'https://docs.voltha.org/master',
- 'howto/release/installVoltctl.html',
- ].join('/')
+ String url = [
+ 'https://docs.voltha.org/master',
+ 'howto/release/installVoltctl.html',
+ ].join('/')
- String error = [
- myname, "ERROR:",
- "Detected release version=[$branch]",
- "but voltctl is not frozen.",
- '',
- "See Also:", url,
- ].join(' ')
- throw new Exception(error)
+ String error = [
+ myname, "ERROR:",
+ "Detected release version=[$branch]",
+ "but voltctl is not frozen.",
+ '',
+ "See Also:", url,
+ ].join(' ')
+ throw new Exception(error)
}
// --------------------------------
// General answer: latest available
// --------------------------------
if (! have_released) {
- url = 'https://api.github.com/repos/opencord/voltctl/releases/latest'
- get_version = [
- "curl -sSL ${url}",
- "jq -r .tag_name",
- "sed -e 's/^v//g'",
- ].join(' | ')
-
- print(" ** RUNNING: ${get_version}")
- released[branch] = sh (
- script: get_version,
- returnStdout: true
- ).trim()
+ url = 'https://api.github.com/repos/opencord/voltctl/releases/latest'
+ get_version = [
+ "curl -sSL ${url}",
+ "jq -r .tag_name",
+ "sed -e 's/^v//g'",
+ ].join(' | ')
+
+ print(" ** RUNNING: ${get_version}")
+ released[branch] = sh (
+ script: get_version,
+ returnStdout: true
+ ).trim()
}
voltctlVersion = released[branch]
@@ -136,6 +165,7 @@
"""
println("** ${iam}: LEAVE")
+ return
}
// -----------------------------------------------------------------------
@@ -145,24 +175,19 @@
String iam = getIam('main')
println("** ${iam}: ENTER")
- /* - unused, string passed as argument
- if (!config) {
- config = [:]
- }
- */
-
try
{
- process(branch)
+ fixPerms()
+ process(branch)
}
catch (Exception err)
{
- println("** ${iam}: EXCEPTION ${err}")
- throw err
+ println("** ${iam}: EXCEPTION ${err}")
+ throw err
}
finally
{
- println("** ${iam}: LEAVE")
+ println("** ${iam}: LEAVE")
}
return
}