From fcf1e7c5f108dce70bc13498a48720c42b287bd3 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 3 May 2018 12:00:31 -0400 Subject: [PATCH 01/44] Attempting to rhel-system-role test to test template --- .../example-test/playbook.yml | 20 ------------------- .../example-test/templates/example-test.j2 | 8 -------- tests/scripts/example-test/test.sh | 1 - tests/scripts/example-test2/test.sh | 1 - tests/scripts/rhel-system-roles/test.sh | 7 +++++++ 5 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 tests/ansible-playbooks/example-test/playbook.yml delete mode 100644 tests/ansible-playbooks/example-test/templates/example-test.j2 delete mode 100644 tests/scripts/example-test/test.sh delete mode 100644 tests/scripts/example-test2/test.sh create mode 100644 tests/scripts/rhel-system-roles/test.sh diff --git a/tests/ansible-playbooks/example-test/playbook.yml b/tests/ansible-playbooks/example-test/playbook.yml deleted file mode 100644 index 194682c..0000000 --- a/tests/ansible-playbooks/example-test/playbook.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Example Test - hosts: all - gather_facts: true - - tasks: - - debug: msg="{{ playbook_dir }}" - - - name: Create output directory - file: path="{{ playbook_dir}}/artifacts" state=directory mode=0755 - - - template: - src: "{{ playbook_dir }}/templates/example-test.j2" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - mode: 0644 - - - fetch: - src: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - flat: yes diff --git a/tests/ansible-playbooks/example-test/templates/example-test.j2 b/tests/ansible-playbooks/example-test/templates/example-test.j2 deleted file mode 100644 index 45cecf0..0000000 --- a/tests/ansible-playbooks/example-test/templates/example-test.j2 +++ /dev/null @@ -1,8 +0,0 @@ -Subject: Example Test [System Architecture="{{ ansible_architecture }}"] - -Report Date: "{{ansible_date_time.date}}" - -Distribution: "{{ansible_distribution}}" -Version: "{{ansible_distribution_version}}" -Hostname: "{{ansible_hostname}}" -Kernel: "{{ansible_kernel}}" diff --git a/tests/scripts/example-test/test.sh b/tests/scripts/example-test/test.sh deleted file mode 100644 index 9b42239..0000000 --- a/tests/scripts/example-test/test.sh +++ /dev/null @@ -1 +0,0 @@ -echo "This is a shell script test" diff --git a/tests/scripts/example-test2/test.sh b/tests/scripts/example-test2/test.sh deleted file mode 100644 index 95290cf..0000000 --- a/tests/scripts/example-test2/test.sh +++ /dev/null @@ -1 +0,0 @@ -echo "This test should run too" diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh new file mode 100644 index 0000000..8aed12d --- /dev/null +++ b/tests/scripts/rhel-system-roles/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# +# Attempts to clone down the test package and run it +workdir=$(pwd) +git clone ssh://jpoulin@pkgs.devel.redhat.com/tests/rhel-system-roles +cd rhel-system-roles/Sanity/Upstream-testsuite +make run > $workdir/artifacts/output.txt From dc884ef94ae4dd02f87678f82af3214e3d5bd671 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Mon, 7 May 2018 14:48:46 -0400 Subject: [PATCH 02/44] Added test playbooks so that the script test runs --- .../example-test/playbook.yml | 20 +++++++++++++++++++ .../example-test/templates/example-test.j2 | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/ansible-playbooks/example-test/playbook.yml create mode 100644 tests/ansible-playbooks/example-test/templates/example-test.j2 diff --git a/tests/ansible-playbooks/example-test/playbook.yml b/tests/ansible-playbooks/example-test/playbook.yml new file mode 100644 index 0000000..194682c --- /dev/null +++ b/tests/ansible-playbooks/example-test/playbook.yml @@ -0,0 +1,20 @@ +--- +- name: Example Test + hosts: all + gather_facts: true + + tasks: + - debug: msg="{{ playbook_dir }}" + + - name: Create output directory + file: path="{{ playbook_dir}}/artifacts" state=directory mode=0755 + + - template: + src: "{{ playbook_dir }}/templates/example-test.j2" + dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" + mode: 0644 + + - fetch: + src: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" + dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" + flat: yes diff --git a/tests/ansible-playbooks/example-test/templates/example-test.j2 b/tests/ansible-playbooks/example-test/templates/example-test.j2 new file mode 100644 index 0000000..45cecf0 --- /dev/null +++ b/tests/ansible-playbooks/example-test/templates/example-test.j2 @@ -0,0 +1,8 @@ +Subject: Example Test [System Architecture="{{ ansible_architecture }}"] + +Report Date: "{{ansible_date_time.date}}" + +Distribution: "{{ansible_distribution}}" +Version: "{{ansible_distribution_version}}" +Hostname: "{{ansible_hostname}}" +Kernel: "{{ansible_kernel}}" From 5e5ba56b38b4723572033dc08f24aa26b9cf0188 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 9 May 2018 11:47:32 -0400 Subject: [PATCH 03/44] Now doing keyscan and installing via rhpkg --- tests/scripts/rhel-system-roles/test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 8aed12d..a6cf8f7 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -2,6 +2,10 @@ # # Attempts to clone down the test package and run it workdir=$(pwd) -git clone ssh://jpoulin@pkgs.devel.redhat.com/tests/rhel-system-roles + +sh-keyscan -H 10.19.208.80 >> ~/.ssh/known_hosts +ssh-keyscan -H pkgs.devel.redhat.com >> ~/.ssh/known_hosts +sudo yum install rhpkg +rhpkg clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite make run > $workdir/artifacts/output.txt From 385f6a703f8048b10fc143d0446f0da23efe4fbb Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 9 May 2018 13:20:07 -0400 Subject: [PATCH 04/44] Attempting to add rhpkg repo for ci --- tests/scripts/rhel-system-roles/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index a6cf8f7..eb11875 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -3,9 +3,15 @@ # Attempts to clone down the test package and run it workdir=$(pwd) -sh-keyscan -H 10.19.208.80 >> ~/.ssh/known_hosts +touch ~/.ssh/known_hosts +ssh-keyscan -H 10.19.208.80 >> ~/.ssh/known_hosts ssh-keyscan -H pkgs.devel.redhat.com >> ~/.ssh/known_hosts -sudo yum install rhpkg + +sudo yum install -y yum-utils +wget -O pnt-devops-rhpkg-continuous-delivery.repo https://copr.devel.redhat.com/coprs/pnt-devops/rhpkg-continuous-delivery/repo/rhel-7/pnt-devops-rhpkg-continuous-delivery +sudo yum-config-manager --add-repo pnt-devops-rhpkg-continuous-delivery.repo +sudo yum install -y rhpkg + rhpkg clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite make run > $workdir/artifacts/output.txt From f9c34c671f3de10b0693479ae950219e18d3d948 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 9 May 2018 15:08:46 -0400 Subject: [PATCH 05/44] Updated tests to get rhpkg from dev dist --- tests/scripts/rhel-system-roles/test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index eb11875..a992792 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Attempts to clone down the test package and run it +cd "$(dirname ${BASH_SOURCE[0]})" workdir=$(pwd) touch ~/.ssh/known_hosts @@ -8,10 +9,11 @@ ssh-keyscan -H 10.19.208.80 >> ~/.ssh/known_hosts ssh-keyscan -H pkgs.devel.redhat.com >> ~/.ssh/known_hosts sudo yum install -y yum-utils -wget -O pnt-devops-rhpkg-continuous-delivery.repo https://copr.devel.redhat.com/coprs/pnt-devops/rhpkg-continuous-delivery/repo/rhel-7/pnt-devops-rhpkg-continuous-delivery -sudo yum-config-manager --add-repo pnt-devops-rhpkg-continuous-delivery.repo +curl -L -O http://download.devel.redhat.com/rel-eng/internal/rcm-tools-rhel-7-server.repo +sudo yum-config-manager --add-repo rcm-tools-rhel-7-server.repo sudo yum install -y rhpkg rhpkg clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite -make run > $workdir/artifacts/output.txt +mkdir -p $workdir/artifacts +make &> $workdir/artifacts/output.txt run From a74331dcf5f7cf8bf3c3c49be055401a84ee2c17 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 9 May 2018 16:52:04 -0400 Subject: [PATCH 06/44] Testing new credentials --- Jenkinsfile | 4 ++-- tests/scripts/rhel-system-roles/test.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 910cd6a..f177f28 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,12 +8,12 @@ properties( name: 'ARCHES' ), string( - defaultValue: 'https://github.com/RedHat-MultiArch-QE/multiarch-ci-libraries', + defaultValue: 'https://github.com/jaypoulz/multiarch-ci-libraries', description: 'Repo for shared libraries.', name: 'LIBRARIES_REPO' ), string( - defaultValue: 'v1.0', + defaultValue: 'dev-v1.0', description: 'Git reference to the branch or tag of shared libraries.', name: 'LIBRARIES_REF' ), diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index a992792..daaa19a 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -4,9 +4,9 @@ cd "$(dirname ${BASH_SOURCE[0]})" workdir=$(pwd) -touch ~/.ssh/known_hosts -ssh-keyscan -H 10.19.208.80 >> ~/.ssh/known_hosts -ssh-keyscan -H pkgs.devel.redhat.com >> ~/.ssh/known_hosts +echo "pkgs.devel.redhat.com,10.19.208.80 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAplqWKs26qsoaTxvWn3DFcdbiBxqRLhFngGiMYhbudnAj4li9/VwAJqLm1M6YfjOoJrj9dlmuXhNzkSzvyoQODaRgsjCG5FaRjuN8CSM/y+glgCYsWX1HFZSnAasLDuW0ifNLPR2RBkmWx61QKq+TxFDjASBbBywtupJcCsA5ktkjLILS+1eWndPJeSUJiOtzhoN8KIigkYveHSetnxauxv1abqwQTk5PmxRgRt20kZEFSRqZOJUlcl85sZYzNC/G7mneptJtHlcNrPgImuOdus5CW+7W49Z/1xqqWI/iRjwipgEMGusPMlSzdxDX4JzIx6R53pDpAwSAQVGDz4F9eQ==" | sudo tee -a /etc/ssh/ssh_known_hosts + +echo "Host pkgs.devel.redhat.com\n IdentityFile /home/jenkins/.ssh/id_rsa\n" | sudo tee -a /etc/ssh/ssh_config sudo yum install -y yum-utils curl -L -O http://download.devel.redhat.com/rel-eng/internal/rcm-tools-rhel-7-server.repo From 4e2873b9b287c3ff08e7624f24cc010458f620d9 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 10 May 2018 17:42:33 -0400 Subject: [PATCH 07/44] Overriding rhpkg user --- tests/scripts/rhel-system-roles/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index daaa19a..ae96dac 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -8,12 +8,12 @@ echo "pkgs.devel.redhat.com,10.19.208.80 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAplq echo "Host pkgs.devel.redhat.com\n IdentityFile /home/jenkins/.ssh/id_rsa\n" | sudo tee -a /etc/ssh/ssh_config -sudo yum install -y yum-utils +sudo yum install -y yum-utils git curl -L -O http://download.devel.redhat.com/rel-eng/internal/rcm-tools-rhel-7-server.repo sudo yum-config-manager --add-repo rcm-tools-rhel-7-server.repo sudo yum install -y rhpkg - -rhpkg clone tests/rhel-system-roles +git config --global user.name "jenkins" +rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite mkdir -p $workdir/artifacts make &> $workdir/artifacts/output.txt run From 027665204b16e888abf6944a322b0964de3ce5a7 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 10 May 2018 19:12:05 -0400 Subject: [PATCH 08/44] Removed newlines from file append --- tests/scripts/rhel-system-roles/test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index ae96dac..952490c 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -6,7 +6,8 @@ workdir=$(pwd) echo "pkgs.devel.redhat.com,10.19.208.80 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAplqWKs26qsoaTxvWn3DFcdbiBxqRLhFngGiMYhbudnAj4li9/VwAJqLm1M6YfjOoJrj9dlmuXhNzkSzvyoQODaRgsjCG5FaRjuN8CSM/y+glgCYsWX1HFZSnAasLDuW0ifNLPR2RBkmWx61QKq+TxFDjASBbBywtupJcCsA5ktkjLILS+1eWndPJeSUJiOtzhoN8KIigkYveHSetnxauxv1abqwQTk5PmxRgRt20kZEFSRqZOJUlcl85sZYzNC/G7mneptJtHlcNrPgImuOdus5CW+7W49Z/1xqqWI/iRjwipgEMGusPMlSzdxDX4JzIx6R53pDpAwSAQVGDz4F9eQ==" | sudo tee -a /etc/ssh/ssh_known_hosts -echo "Host pkgs.devel.redhat.com\n IdentityFile /home/jenkins/.ssh/id_rsa\n" | sudo tee -a /etc/ssh/ssh_config +echo "Host pkgs.devel.redhat.com" | sudo tee -a /etc/ssh/ssh_config +echo "IdentityFile /home/jenkins/.ssh/id_rsa" | sudo tee -a /etc/ssh/ssh_config sudo yum install -y yum-utils git curl -L -O http://download.devel.redhat.com/rel-eng/internal/rcm-tools-rhel-7-server.repo From 7acb70b0689d40131c96c62d6e4cbe60b4d72a7c Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 11 May 2018 15:17:09 -0400 Subject: [PATCH 09/44] Attempting to call sudo run these tests as root --- tests/scripts/rhel-system-roles/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 952490c..d7f9d97 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -17,4 +17,4 @@ git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite mkdir -p $workdir/artifacts -make &> $workdir/artifacts/output.txt run +sudo make &> $workdir/artifacts/output.txt run From 5fd6a08ddf159d9628c5daabd271eb03925ea51e Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 11 May 2018 16:16:08 -0400 Subject: [PATCH 10/44] Specifying output directory so there is no more name conflict: --- tests/scripts/rhel-system-roles/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index d7f9d97..083aa6c 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -16,5 +16,5 @@ sudo yum install -y rhpkg git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite -mkdir -p $workdir/artifacts -sudo make &> $workdir/artifacts/output.txt run +mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" +sudo make &> "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" run From d3e5ee457eb159f7de3ff3572a7c1c32605361ec Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 11 May 2018 17:02:00 -0400 Subject: [PATCH 11/44] Updating to use newer test developed by Leos --- tests/scripts/rhel-system-roles/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 083aa6c..ebf6b56 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -15,6 +15,6 @@ sudo yum-config-manager --add-repo rcm-tools-rhel-7-server.repo sudo yum install -y rhpkg git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles -cd rhel-system-roles/Sanity/Upstream-testsuite +cd rhel-system-roles/Sanity/Upstream-testsuite-multiarch-ci mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" sudo make &> "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" run From ae20a98e4a2a388e6981893659f45b2d1dc18413 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 11 May 2018 17:15:54 -0400 Subject: [PATCH 12/44] Removed overeager directory creation --- tests/scripts/rhel-system-roles/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index ebf6b56..6a230bd 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -16,5 +16,5 @@ sudo yum install -y rhpkg git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles/Sanity/Upstream-testsuite-multiarch-ci -mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" +mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)" sudo make &> "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" run From f48674a8a6271a49cbb92f0c710beb40fe0ae1a2 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Mon, 14 May 2018 14:05:39 -0400 Subject: [PATCH 13/44] Targeting dev libraries --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 910cd6a..f177f28 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,12 +8,12 @@ properties( name: 'ARCHES' ), string( - defaultValue: 'https://github.com/RedHat-MultiArch-QE/multiarch-ci-libraries', + defaultValue: 'https://github.com/jaypoulz/multiarch-ci-libraries', description: 'Repo for shared libraries.', name: 'LIBRARIES_REPO' ), string( - defaultValue: 'v1.0', + defaultValue: 'dev-v1.0', description: 'Git reference to the branch or tag of shared libraries.', name: 'LIBRARIES_REF' ), From b97f80196815465dd18285e1bebe56ca6393219f Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Tue, 15 May 2018 11:42:23 -0400 Subject: [PATCH 14/44] Test should now operate from git tag --- tests/scripts/rhel-system-roles/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 6a230bd..542690b 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -15,6 +15,8 @@ sudo yum-config-manager --add-repo rcm-tools-rhel-7-server.repo sudo yum install -y rhpkg git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles -cd rhel-system-roles/Sanity/Upstream-testsuite-multiarch-ci +cd rhel-system-roles +git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 +cd Sanity/Upstream-testsuite-multiarch-ci mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)" sudo make &> "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" run From 000f4d15780f16e8f783bf2bdffd04c9589a0739 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 13:13:44 -0400 Subject: [PATCH 15/44] Added configuration for auto-build on brew package update --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f177f28..82c2961 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,16 @@ properties( [ + pipelineTriggers( + [ + [ + $class: 'CIBuildTrigger', + checks: [], + overrides: [topic: "Consumer.rh-jenkins-ci-plugin.afe3c710-9a13-4039-98d4-0f7c2c74a60b.VirtualTopic.qe.ci.>"], + providerName: 'Red Hat UMB', + selector: 'name = \'ansible\' AND CI_TYPE = \'brew-tag\' AND tag LIKE \'ansible-%-rhel-%-candidate\'' + ] + ] + ), parameters( [ string( @@ -36,6 +47,11 @@ properties( defaultValue: '', description: 'Contains the CI_MESSAGE for a message bus triggered build.', name: 'CI_MESSAGE' + ), + string( + defaultValue: '', + description: 'Build task ID for which to run the pipeline', + name: 'TASK_ID' ) ] ) @@ -60,6 +76,22 @@ TestUtils.runParallelMultiArchTest( /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ + def createTaskRepo = false; + if (params.CI_MESSAGE != '') { + tid = getTaskId(params.CI_MESSAGE) + createTaskRepo(taskIds: tid) + } else if (params.TASK_ID != '') { + createTaskRepo(taskIds: params.TASK_ID) + } + + if (taskRepoCreated) { + sh """ + URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g' | grep ${host.arch}) + sudo yum-config-manager --add-repo \${URL} + sudo yum --nogpgcheck install -y ansible + """ + } + dir('test') { stage ('Download Test Files') { downloadTests() From 2983048b2833a066ada6d12db706f1f03e38dfce Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 14:19:16 -0400 Subject: [PATCH 16/44] Added boolean vars for test repo --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 82c2961..b64e747 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,15 +76,17 @@ TestUtils.runParallelMultiArchTest( /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - def createTaskRepo = false; + def createTaskRepo = false if (params.CI_MESSAGE != '') { tid = getTaskId(params.CI_MESSAGE) createTaskRepo(taskIds: tid) + taskRepoCreated = true } else if (params.TASK_ID != '') { createTaskRepo(taskIds: params.TASK_ID) + taskRepoCreated = true } - if (taskRepoCreated) { + if (taskRepoCreated == true) { sh """ URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g' | grep ${host.arch}) sudo yum-config-manager --add-repo \${URL} From 2f05d032fa57b375b294d7bdb08f1d95ac804ba1 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 15:34:33 -0400 Subject: [PATCH 17/44] Fixed broken variable --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b64e747..85c2948 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,7 +76,7 @@ TestUtils.runParallelMultiArchTest( /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - def createTaskRepo = false + def taskRepoCreated = false if (params.CI_MESSAGE != '') { tid = getTaskId(params.CI_MESSAGE) createTaskRepo(taskIds: tid) From f6cc6f648308271e48f1aea9f0624b616eb4b306 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 16:01:40 -0400 Subject: [PATCH 18/44] Updated Jenkinsfile for container test --- Jenkinsfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 85c2948..6e00c03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,15 +67,22 @@ library( List arches = params.ARCHES.tokenize(',') def config = TestUtils.getProvisioningConfig(this) -TestUtils.runParallelMultiArchTest( - this, - arches, - config, - { host -> +node ('provisioner-v1.0') { /*********************************************************/ /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ + def host = [] + host.arch = 'x86_64' + host.hostName = 'localhost' + host.name = 'provisioner-v1.0' + host.target = null + host.inventory = null + host.initialized = true + host.provisioned = true + host.connectedToMaster = true + host.ansibledInstalled = true + def taskRepoCreated = false if (params.CI_MESSAGE != '') { tid = getTaskId(params.CI_MESSAGE) @@ -112,11 +119,4 @@ TestUtils.runParallelMultiArchTest( /* END TEST BODY */ /* Do not edit beyond this point */ /*****************************************************************/ - }, - { Exception exception, def host -> - echo "Exception ${exception} occured on ${host.arch}" - if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { - currentBuild.result = 'FAILURE' - } - } -) +} From 89687c5661e50002f9e385789f73d4784ab7ee7d Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 16:25:32 -0400 Subject: [PATCH 19/44] Updated host object --- Jenkinsfile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e00c03..4c0077c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,16 +72,17 @@ node ('provisioner-v1.0') { /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - def host = [] - host.arch = 'x86_64' - host.hostName = 'localhost' - host.name = 'provisioner-v1.0' - host.target = null - host.inventory = null - host.initialized = true - host.provisioned = true - host.connectedToMaster = true - host.ansibledInstalled = true + def host = [ + arch: 'x86_64', + hostName: 'localhost', + name: 'provisioner-v1.0', + target: null, + inventory: null, + initialized: true, + provisioned: true, + connectedToMaster: true, + ansibledInstalled: true + ] def taskRepoCreated = false if (params.CI_MESSAGE != '') { @@ -95,6 +96,8 @@ node ('provisioner-v1.0') { if (taskRepoCreated == true) { sh """ + ls + cat task-repo.properties URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g' | grep ${host.arch}) sudo yum-config-manager --add-repo \${URL} sudo yum --nogpgcheck install -y ansible From f9dded7df6ea252623b7b9bb59e227bc5ba1b6b5 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 16:43:04 -0400 Subject: [PATCH 20/44] Removing filter for arch --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4c0077c..e570c31 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,9 +96,8 @@ node ('provisioner-v1.0') { if (taskRepoCreated == true) { sh """ - ls cat task-repo.properties - URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g' | grep ${host.arch}) + URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} sudo yum --nogpgcheck install -y ansible """ From 8520e563ba0d0beb57cfdf98cc17f8d1fd03b2a7 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 16:46:41 -0400 Subject: [PATCH 21/44] Added default build id --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e570c31..5d8fb40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,7 +49,7 @@ properties( name: 'CI_MESSAGE' ), string( - defaultValue: '', + defaultValue: '15911696', description: 'Build task ID for which to run the pipeline', name: 'TASK_ID' ) From 5e4fc4765b41f46b0051c6d99eb76b5ec1828d26 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 16:55:41 -0400 Subject: [PATCH 22/44] Removing arch filter so that repo is found --- Jenkinsfile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d8fb40..45d1493 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,23 +67,15 @@ library( List arches = params.ARCHES.tokenize(',') def config = TestUtils.getProvisioningConfig(this) -node ('provisioner-v1.0') { +TestUtils.runParallelMultiArchTest( + this, + arches, + config, + { host -> /*********************************************************/ /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - def host = [ - arch: 'x86_64', - hostName: 'localhost', - name: 'provisioner-v1.0', - target: null, - inventory: null, - initialized: true, - provisioned: true, - connectedToMaster: true, - ansibledInstalled: true - ] - def taskRepoCreated = false if (params.CI_MESSAGE != '') { tid = getTaskId(params.CI_MESSAGE) @@ -96,7 +88,6 @@ node ('provisioner-v1.0') { if (taskRepoCreated == true) { sh """ - cat task-repo.properties URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} sudo yum --nogpgcheck install -y ansible @@ -121,4 +112,11 @@ node ('provisioner-v1.0') { /* END TEST BODY */ /* Do not edit beyond this point */ /*****************************************************************/ -} + }, + { Exception exception, def host -> + echo "Exception ${exception} occured on ${host.arch}" + if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { + currentBuild.result = 'FAILURE' + } + } +) From f9f0b2b8edb57992f94f8925ddcc741a6cc28d14 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 17:47:18 -0400 Subject: [PATCH 23/44] Install yum-utils --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 45d1493..293d077 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,6 +88,7 @@ TestUtils.runParallelMultiArchTest( if (taskRepoCreated == true) { sh """ + sudo yum install -y yum-utils URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} sudo yum --nogpgcheck install -y ansible From 8df4ca0c3572d452d1958c472b4d06d4ffa23fd2 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 19:13:32 -0400 Subject: [PATCH 24/44] Attempting to disable yum repo after since it has not gpg check --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 293d077..6326e27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,6 +92,7 @@ TestUtils.runParallelMultiArchTest( URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} sudo yum --nogpgcheck install -y ansible + sudo yum-config-manager --disable=\${URL} """ } From 9836a9b5fb3c0d97409575662560ce285fe06962 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 20:55:17 -0400 Subject: [PATCH 25/44] Disabling gpgchecks for installed repos --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6326e27..10fe867 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,8 +91,8 @@ TestUtils.runParallelMultiArchTest( sudo yum install -y yum-utils URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} + sudo sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/*download.eng.bos.redhat.com* sudo yum --nogpgcheck install -y ansible - sudo yum-config-manager --disable=\${URL} """ } From 2960bc4f3c649cf50edbc8cec91c7308d9490eb1 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 16 May 2018 21:59:31 -0400 Subject: [PATCH 26/44] Ensuring gpgcheck=0 is in the repo file in case it actually isn't --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 10fe867..a30cd09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,8 +91,11 @@ TestUtils.runParallelMultiArchTest( sudo yum install -y yum-utils URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') sudo yum-config-manager --add-repo \${URL} + sudo cat /etc/yum.repos.d/*download.eng.bos.redhat.com* sudo sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/*download.eng.bos.redhat.com* - sudo yum --nogpgcheck install -y ansible + echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/*download.eng.bos.redhat.com* + sudo yum clean all + sudo yum install -y ansible """ } From 07e445e61ca91acb604351d951759e65a127dfe9 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 15:03:20 -0400 Subject: [PATCH 27/44] Simplified test template so that config change is the only main change --- Jenkinsfile | 26 +++---------------------- tests/scripts/rhel-system-roles/test.sh | 11 ----------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a30cd09..a13d019 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ properties( name: 'LIBRARIES_REPO' ), string( - defaultValue: 'dev-v1.0', + defaultValue: 'dev-v1.0-ae-test', description: 'Git reference to the branch or tag of shared libraries.', name: 'LIBRARIES_REF' ), @@ -66,6 +66,7 @@ library( List arches = params.ARCHES.tokenize(',') def config = TestUtils.getProvisioningConfig(this) +config.installRhpkg = true TestUtils.runParallelMultiArchTest( this, @@ -76,28 +77,7 @@ TestUtils.runParallelMultiArchTest( /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - def taskRepoCreated = false - if (params.CI_MESSAGE != '') { - tid = getTaskId(params.CI_MESSAGE) - createTaskRepo(taskIds: tid) - taskRepoCreated = true - } else if (params.TASK_ID != '') { - createTaskRepo(taskIds: params.TASK_ID) - taskRepoCreated = true - } - - if (taskRepoCreated == true) { - sh """ - sudo yum install -y yum-utils - URL=\$(cat task-repo.properties | grep TASK_REPO_URLS= | sed 's/TASK_REPO_URLS=//' | sed 's/;/\\n/g') - sudo yum-config-manager --add-repo \${URL} - sudo cat /etc/yum.repos.d/*download.eng.bos.redhat.com* - sudo sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/*download.eng.bos.redhat.com* - echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/*download.eng.bos.redhat.com* - sudo yum clean all - sudo yum install -y ansible - """ - } + installBrewPkgs(params) dir('test') { stage ('Download Test Files') { diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 542690b..9322736 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -3,17 +3,6 @@ # Attempts to clone down the test package and run it cd "$(dirname ${BASH_SOURCE[0]})" workdir=$(pwd) - -echo "pkgs.devel.redhat.com,10.19.208.80 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAplqWKs26qsoaTxvWn3DFcdbiBxqRLhFngGiMYhbudnAj4li9/VwAJqLm1M6YfjOoJrj9dlmuXhNzkSzvyoQODaRgsjCG5FaRjuN8CSM/y+glgCYsWX1HFZSnAasLDuW0ifNLPR2RBkmWx61QKq+TxFDjASBbBywtupJcCsA5ktkjLILS+1eWndPJeSUJiOtzhoN8KIigkYveHSetnxauxv1abqwQTk5PmxRgRt20kZEFSRqZOJUlcl85sZYzNC/G7mneptJtHlcNrPgImuOdus5CW+7W49Z/1xqqWI/iRjwipgEMGusPMlSzdxDX4JzIx6R53pDpAwSAQVGDz4F9eQ==" | sudo tee -a /etc/ssh/ssh_known_hosts - -echo "Host pkgs.devel.redhat.com" | sudo tee -a /etc/ssh/ssh_config -echo "IdentityFile /home/jenkins/.ssh/id_rsa" | sudo tee -a /etc/ssh/ssh_config - -sudo yum install -y yum-utils git -curl -L -O http://download.devel.redhat.com/rel-eng/internal/rcm-tools-rhel-7-server.repo -sudo yum-config-manager --add-repo rcm-tools-rhel-7-server.repo -sudo yum install -y rhpkg -git config --global user.name "jenkins" rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 From d13a02a176c49284f815f7ebf2286220a448d15f Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 15:11:11 -0400 Subject: [PATCH 28/44] Adding a scan for pass/fail --- tests/ansible-playbooks/example-test/playbook.yml | 8 ++++---- tests/scripts/rhel-system-roles/test.sh | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/ansible-playbooks/example-test/playbook.yml b/tests/ansible-playbooks/example-test/playbook.yml index 194682c..4849d50 100644 --- a/tests/ansible-playbooks/example-test/playbook.yml +++ b/tests/ansible-playbooks/example-test/playbook.yml @@ -7,14 +7,14 @@ - debug: msg="{{ playbook_dir }}" - name: Create output directory - file: path="{{ playbook_dir}}/artifacts" state=directory mode=0755 + file: path="{{ playbook_dir}}/artifacts/example-test" state=directory mode=0755 - template: src: "{{ playbook_dir }}/templates/example-test.j2" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" + dest: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" mode: 0644 - fetch: - src: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" + src: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + dest: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" flat: yes diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 9322736..1e05dd6 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -7,5 +7,7 @@ rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 cd Sanity/Upstream-testsuite-multiarch-ci -mkdir -p "$workdir/artifacts/rhel-system-roles/$(arch)" -sudo make &> "$workdir/artifacts/rhel-system-roles/$(arch)/output.txt" run +output="$workdir/artifacts/rhel-system-roles/$(arch)" +mkdir -p $output +sudo make &> $output run +grep "OVERALL RESULT" $output | grep "PASS" From 703f4d8f3baa6ba841f32984e4951bbcf4f84474 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 16:02:41 -0400 Subject: [PATCH 29/44] Added email notification --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a13d019..0c096c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,4 +104,12 @@ TestUtils.runParallelMultiArchTest( currentBuild.result = 'FAILURE' } } + + emailext( + subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + from: 'multiarch-qe-jenkins', + replyTo: 'multiarch-qe', + to: 'jpoulin' + )_ ) From af7f452e88e35703ddc427d7bd0ed08ed99da988 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 16:07:08 -0400 Subject: [PATCH 30/44] moved email out of limbo --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0c096c8..983682d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,12 +104,12 @@ TestUtils.runParallelMultiArchTest( currentBuild.result = 'FAILURE' } } +) - emailext( +emailext( subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", from: 'multiarch-qe-jenkins', replyTo: 'multiarch-qe', to: 'jpoulin' - )_ -) + ) From 02b1a86afefd8738bbf10e470b67e34aa75e43cf Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 17:14:07 -0400 Subject: [PATCH 31/44] Adding a finally block to Jenkinsfile --- Jenkinsfile | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 983682d..326cfd6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ properties( - [ + [ pipelineTriggers( [ [ @@ -79,18 +79,16 @@ TestUtils.runParallelMultiArchTest( /*********************************************************/ installBrewPkgs(params) - dir('test') { - stage ('Download Test Files') { - downloadTests() - } + stage ('Download Test Files') { + downloadTests() + } - stage ('Run Test') { - runTests(config, host) - } + stage ('Run Test') { + runTests(config, host) + } - stage ('Archive Test Output') { - archiveOutput() - } + stage ('Archive Test Output') { + archiveOutput() } /*****************************************************************/ @@ -103,13 +101,16 @@ TestUtils.runParallelMultiArchTest( if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { currentBuild.result = 'FAILURE' } + }, + { + emailext( + subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + from: 'multiarch-qe-jenkins', + replyTo: 'multiarch-qe', + to: 'jpoulin', + attachmentsPattern: '${params.TEST_DIR}/**/**/artifacts/**/*.*' + ) } ) -emailext( - subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", - body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", - from: 'multiarch-qe-jenkins', - replyTo: 'multiarch-qe', - to: 'jpoulin' - ) From 75c37b124f9bf8de9aa3dacb065dd68364388c4c Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 20:52:00 -0400 Subject: [PATCH 32/44] Updated example test --- .../example-test/playbook.yml | 20 ------------------- .../host-summary/playbook.yml | 20 +++++++++++++++++++ .../templates/host-summary.j2} | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 tests/ansible-playbooks/example-test/playbook.yml create mode 100644 tests/ansible-playbooks/host-summary/playbook.yml rename tests/ansible-playbooks/{example-test/templates/example-test.j2 => host-summary/templates/host-summary.j2} (75%) diff --git a/tests/ansible-playbooks/example-test/playbook.yml b/tests/ansible-playbooks/example-test/playbook.yml deleted file mode 100644 index 4849d50..0000000 --- a/tests/ansible-playbooks/example-test/playbook.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Example Test - hosts: all - gather_facts: true - - tasks: - - debug: msg="{{ playbook_dir }}" - - - name: Create output directory - file: path="{{ playbook_dir}}/artifacts/example-test" state=directory mode=0755 - - - template: - src: "{{ playbook_dir }}/templates/example-test.j2" - dest: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" - mode: 0644 - - - fetch: - src: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" - dest: "{{ playbook_dir }}/artifacts/example-test/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" - flat: yes diff --git a/tests/ansible-playbooks/host-summary/playbook.yml b/tests/ansible-playbooks/host-summary/playbook.yml new file mode 100644 index 0000000..83fb1e0 --- /dev/null +++ b/tests/ansible-playbooks/host-summary/playbook.yml @@ -0,0 +1,20 @@ +--- +- name: Host Summary + hosts: all + gather_facts: true + + tasks: + - debug: msg="{{ playbook_dir }}" + + - name: Create output directory + file: path="{{ playbook_dir}}/artifacts/host-summary/{{ ansible_architecture }}" state=directory mode=0755 + + - template: + src: "{{ playbook_dir }}/templates/host-summary.j2" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + mode: 0644 + + - fetch: + src: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + flat: yes diff --git a/tests/ansible-playbooks/example-test/templates/example-test.j2 b/tests/ansible-playbooks/host-summary/templates/host-summary.j2 similarity index 75% rename from tests/ansible-playbooks/example-test/templates/example-test.j2 rename to tests/ansible-playbooks/host-summary/templates/host-summary.j2 index 45cecf0..f6bb53e 100644 --- a/tests/ansible-playbooks/example-test/templates/example-test.j2 +++ b/tests/ansible-playbooks/host-summary/templates/host-summary.j2 @@ -1,4 +1,4 @@ -Subject: Example Test [System Architecture="{{ ansible_architecture }}"] +Subject: Host Summary [System Architecture="{{ ansible_architecture }}"] Report Date: "{{ansible_date_time.date}}" From 27f65c5d064ec837bed430d324303c76f959a14a Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 21:42:29 -0400 Subject: [PATCH 33/44] Added results.txt path and error notifications --- Jenkinsfile | 8 ++++++-- tests/scripts/rhel-system-roles/test.sh | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 326cfd6..496487f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,6 +68,8 @@ List arches = params.ARCHES.tokenize(',') def config = TestUtils.getProvisioningConfig(this) config.installRhpkg = true +def errorMessage = '' + TestUtils.runParallelMultiArchTest( this, arches, @@ -97,7 +99,9 @@ TestUtils.runParallelMultiArchTest( /*****************************************************************/ }, { Exception exception, def host -> - echo "Exception ${exception} occured on ${host.arch}" + def error = "Exception ${exception} occured on ${host.arch}\n" + echo error + errorMessages += error if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { currentBuild.result = 'FAILURE' } @@ -105,7 +109,7 @@ TestUtils.runParallelMultiArchTest( { emailext( subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", - body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n", from: 'multiarch-qe-jenkins', replyTo: 'multiarch-qe', to: 'jpoulin', diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 1e05dd6..2a4969a 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -8,6 +8,6 @@ cd rhel-system-roles git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 cd Sanity/Upstream-testsuite-multiarch-ci output="$workdir/artifacts/rhel-system-roles/$(arch)" -mkdir -p $output -sudo make &> $output run -grep "OVERALL RESULT" $output | grep "PASS" +mkdir -p $output_dir +sudo make &> $output_dir/results.txt run +grep "OVERALL RESULT" $output/results.txt | grep "PASS" From 130a6c2cfa73625e33d54ecab02aedbee6ae63be Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Thu, 17 May 2018 23:42:42 -0400 Subject: [PATCH 34/44] Trying to unarchive rhel system roles output --- Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 496487f..78b1ce7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,7 +68,7 @@ List arches = params.ARCHES.tokenize(',') def config = TestUtils.getProvisioningConfig(this) config.installRhpkg = true -def errorMessage = '' +def errorMessages = '' TestUtils.runParallelMultiArchTest( this, @@ -107,14 +107,16 @@ TestUtils.runParallelMultiArchTest( } }, { - emailext( - subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", - body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n", - from: 'multiarch-qe-jenkins', - replyTo: 'multiarch-qe', - to: 'jpoulin', - attachmentsPattern: '${params.TEST_DIR}/**/**/artifacts/**/*.*' - ) } ) +unarchive mapping: ['rhel-system-roles/' : '.'] +emailext( + subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n" + errorMessages, + from: 'multiarch-qe-jenkins', + replyTo: 'multiarch-qe', + to: 'jpoulin', + attachmentsPattern: 'rhel-system-roles/**/*.*' +) + From 3946077a691afd5664ab10ca5a0348a60590ffc1 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 10:32:19 -0400 Subject: [PATCH 35/44] Added try catch around unarchive --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 78b1ce7..cdfb1d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -110,7 +110,11 @@ TestUtils.runParallelMultiArchTest( } ) -unarchive mapping: ['rhel-system-roles/' : '.'] +try { + unarchive(mapping: ['rhel-system-roles/' : '.']) +} catch (e) { +} + emailext( subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n" + errorMessages, From 48df85287a79c0f8abd09b4fc297307dc8de34b2 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 10:41:04 -0400 Subject: [PATCH 36/44] Removing needless error printing --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cdfb1d0..b619c1c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -100,7 +100,6 @@ TestUtils.runParallelMultiArchTest( }, { Exception exception, def host -> def error = "Exception ${exception} occured on ${host.arch}\n" - echo error errorMessages += error if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { currentBuild.result = 'FAILURE' From 5acbcdfd190a2dc4d513d379af076938f8cc4f8b Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 13:38:38 -0400 Subject: [PATCH 37/44] Fixed bad var name --- tests/scripts/rhel-system-roles/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 2a4969a..efd8feb 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -7,7 +7,7 @@ rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 cd Sanity/Upstream-testsuite-multiarch-ci -output="$workdir/artifacts/rhel-system-roles/$(arch)" +output_dir="$workdir/artifacts/rhel-system-roles/$(arch)" mkdir -p $output_dir sudo make &> $output_dir/results.txt run grep "OVERALL RESULT" $output/results.txt | grep "PASS" From d0902e99a1ea04a7ac75afc05ade0c4f613142a0 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 13:42:20 -0400 Subject: [PATCH 38/44] Updated build # and subscription id --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b619c1c..6a123d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ properties( [ $class: 'CIBuildTrigger', checks: [], - overrides: [topic: "Consumer.rh-jenkins-ci-plugin.afe3c710-9a13-4039-98d4-0f7c2c74a60b.VirtualTopic.qe.ci.>"], + overrides: [topic: "Consumer.rh-jenkins-ci-plugin.4ed73c82-6707-4f06-9ad5-b4af7d5116d8.VirtualTopic.qe.ci.>"], providerName: 'Red Hat UMB', selector: 'name = \'ansible\' AND CI_TYPE = \'brew-tag\' AND tag LIKE \'ansible-%-rhel-%-candidate\'' ] @@ -49,7 +49,7 @@ properties( name: 'CI_MESSAGE' ), string( - defaultValue: '15911696', + defaultValue: '16364269', description: 'Build task ID for which to run the pipeline', name: 'TASK_ID' ) From 3244b7ee5e02636e38f5da20832ef39bf6c23139 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 15:31:19 -0400 Subject: [PATCH 39/44] Fixed variable name --- tests/scripts/rhel-system-roles/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index efd8feb..641fc16 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -10,4 +10,4 @@ cd Sanity/Upstream-testsuite-multiarch-ci output_dir="$workdir/artifacts/rhel-system-roles/$(arch)" mkdir -p $output_dir sudo make &> $output_dir/results.txt run -grep "OVERALL RESULT" $output/results.txt | grep "PASS" +grep "OVERALL RESULT" $output_dir/results.txt | grep "PASS" From 38752386db282d05469e1a5c0db376415c31f820 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 15:39:08 -0400 Subject: [PATCH 40/44] Attempting to unarchive all archived files --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6a123d1..8dcec40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -110,7 +110,8 @@ TestUtils.runParallelMultiArchTest( ) try { - unarchive(mapping: ['rhel-system-roles/' : '.']) + sh "mkdir -p artifacts" + unarchive(mapping: ['**/*.*' : 'artifacts/.']) } catch (e) { } @@ -120,6 +121,6 @@ emailext( from: 'multiarch-qe-jenkins', replyTo: 'multiarch-qe', to: 'jpoulin', - attachmentsPattern: 'rhel-system-roles/**/*.*' + attachmentsPattern: 'artifacts/**/*.*' ) From 8e71ad061b49f9a22ed39c493299a0ecc53f83e2 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Fri, 18 May 2018 18:03:46 -0400 Subject: [PATCH 41/44] Added email back to the postTest --- Jenkinsfile | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8dcec40..d423dfa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ properties( - [ + [ pipelineTriggers( [ [ @@ -82,7 +82,7 @@ TestUtils.runParallelMultiArchTest( installBrewPkgs(params) stage ('Download Test Files') { - downloadTests() + downloadTests() } stage ('Run Test') { @@ -106,21 +106,19 @@ TestUtils.runParallelMultiArchTest( } }, { - } -) - -try { - sh "mkdir -p artifacts" - unarchive(mapping: ['**/*.*' : 'artifacts/.']) -} catch (e) { -} + try { + sh "mkdir -p artifacts" + unarchive(mapping: ['**/*.*' : 'artifacts/.']) + } catch (e) { + } -emailext( - subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", - body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n" + errorMessages, - from: 'multiarch-qe-jenkins', - replyTo: 'multiarch-qe', - to: 'jpoulin', - attachmentsPattern: 'artifacts/**/*.*' + emailext( + subject: "${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}", + body:"${env.JOB_NAME} - Build #${currentBuild.number} - ${currentBuild.currentResult}\n\n" + errorMessages, + from: 'multiarch-qe-jenkins', + replyTo: 'multiarch-qe', + to: 'jpoulin', + attachmentsPattern: 'artifacts/**/*.*' + ) + } ) - From 11228d4f7a7b212ccb0718e401cbb0b0fef9b372 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Tue, 22 May 2018 13:54:07 -0400 Subject: [PATCH 42/44] Changed output file names --- tests/ansible-playbooks/host-summary/playbook.yml | 8 ++++---- tests/scripts/rhel-system-roles/test.sh | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/ansible-playbooks/host-summary/playbook.yml b/tests/ansible-playbooks/host-summary/playbook.yml index 83fb1e0..a76896d 100644 --- a/tests/ansible-playbooks/host-summary/playbook.yml +++ b/tests/ansible-playbooks/host-summary/playbook.yml @@ -7,14 +7,14 @@ - debug: msg="{{ playbook_dir }}" - name: Create output directory - file: path="{{ playbook_dir}}/artifacts/host-summary/{{ ansible_architecture }}" state=directory mode=0755 + file: path="{{ playbook_dir}}/artifacts/host-summary" state=directory mode=0755 - template: src: "{{ playbook_dir }}/templates/host-summary.j2" - dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" mode: 0644 - fetch: - src: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" - dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}/{{ inventory_hostname }}.txt" + src: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" flat: yes diff --git a/tests/scripts/rhel-system-roles/test.sh b/tests/scripts/rhel-system-roles/test.sh index 641fc16..b6a5dc3 100644 --- a/tests/scripts/rhel-system-roles/test.sh +++ b/tests/scripts/rhel-system-roles/test.sh @@ -7,7 +7,8 @@ rhpkg --verbose --user=jenkins clone tests/rhel-system-roles cd rhel-system-roles git checkout CoreOS-rhel-system-roles-Sanity-Upstream-testsuite-multiarch-ci-1_1-1 cd Sanity/Upstream-testsuite-multiarch-ci -output_dir="$workdir/artifacts/rhel-system-roles/$(arch)" +output_dir="$workdir/artifacts/rhel-system-roles" +output_file="$output_dir/$(arch).txt" mkdir -p $output_dir -sudo make &> $output_dir/results.txt run -grep "OVERALL RESULT" $output_dir/results.txt | grep "PASS" +sudo make &> $output_file run +grep "OVERALL RESULT" $output_file | grep "PASS" From ed247d483dc2f903ed8a804158f687dec96e9654 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Tue, 22 May 2018 14:08:37 -0400 Subject: [PATCH 43/44] Moving error var --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 320cbcd..8aca052 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,8 +49,8 @@ library( ) List arches = params.ARCHES.tokenize(',') -def config = TestUtils.getProvisioningConfig(this) def errorMessages = '' +def config = TestUtils.getProvisioningConfig(this) TestUtils.runParallelMultiArchTest( this, From 3096229afbcd1bedf42af6e1ed1181668a84a316 Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Wed, 23 May 2018 11:16:06 -0400 Subject: [PATCH 44/44] Updating dev branch to releasable version --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8aca052..9091933 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,12 +8,12 @@ properties( name: 'ARCHES' ), string( - defaultValue: 'https://github.com/jaypoulz/multiarch-ci-libraries', + defaultValue: 'https://github.com/RedHat-MultiArch-QE/multiarch-ci-libraries', description: 'Repo for shared libraries.', name: 'LIBRARIES_REPO' ), string( - defaultValue: 'dev-v1.0', + defaultValue: 'v1.0', description: 'Git reference to the branch or tag of shared libraries.', name: 'LIBRARIES_REF' ),