]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Initial MOS templates commit 36/40536/30
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 18 Feb 2019 07:19:02 +0000 (11:19 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Wed, 6 Mar 2019 08:54:08 +0000 (12:54 +0400)
Soul of patching-ci now lives here...

Change-Id: If45d64c506540a4f4edaee9c1c416b93061cc8ba

44 files changed:
maintenance-ci/common/data/mos-slave.yml [new file with mode: 0644]
maintenance-ci/common/jobs/build-swarm-image.yaml
maintenance-ci/common/jobs/delete-stack.yaml [moved from maintenance-ci/common/jobs/delete_stack.yaml with 60% similarity]
maintenance-ci/common/jobs/deploy-jenkins-swarm.yaml
maintenance-ci/common/jobs/deploy-stack.yaml
maintenance-ci/common/jobs/multijob-build-image.yaml
maintenance-ci/common/jobs/update-jenkins-jobs.yaml [new file with mode: 0644]
maintenance-ci/common/jobs/update_jenkins_jobs.yaml [deleted file]
maintenance-ci/common/macroses/inject-text-parameter.yaml [new file with mode: 0644]
maintenance-ci/common/macroses/mos-jenkins-swarm-params.yaml [new file with mode: 0644]
maintenance-ci/common/macroses/openstack_creds.yaml
maintenance-ci/common/scripts/deploy_heat_stack.sh
maintenance-ci/common/scripts/deploy_jenkins_swarm.sh
maintenance-ci/common/scripts/update_jenkins_jobs.sh
maintenance-ci/mos/.keep [deleted file]
maintenance-ci/mos/data/8.0-iso [new file with mode: 0644]
maintenance-ci/mos/data/9.0-iso [new file with mode: 0644]
maintenance-ci/mos/jobs/9.x.swarm.micro.runner.yaml [new file with mode: 0644]
maintenance-ci/mos/jobs/9.x.swarm.runner.yaml [new file with mode: 0644]
maintenance-ci/mos/jobs/9.x.swarm.tests.yaml [new file with mode: 0644]
maintenance-ci/mos/jobs/9.x.test-reports.yaml [new file with mode: 0644]
maintenance-ci/mos/jobs/snapshot.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/9x-run-sys-test.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/9x-systest-params.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/9x-systest-repos-parsing.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/guess-mirror.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/inject-properties-file.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/make-snapshots.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/post-destroy-vm.yaml [new file with mode: 0644]
maintenance-ci/mos/macroses/write-description.yaml [new file with mode: 0644]
maintenance-ci/mos/scripts/freeze_deps_for_systest.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/freeze_deps_for_systest_plugin.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/fuel_qa_launch_test.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/guess-mirror.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/snapshot.params.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/systest_repos_parsing.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/testrail-report-9.x.sh [new file with mode: 0644]
maintenance-ci/mos/scripts/testrail-upload-cases-9.x.sh [new file with mode: 0644]
maintenance-ci/mos/templates/snapshot.yaml [new file with mode: 0644]
maintenance-ci/mos/templates/swarm-test.yaml [new file with mode: 0644]
maintenance-ci/mos/templates/testrail-report-9.x.yaml [new file with mode: 0644]
maintenance-ci/views/.keep [deleted file]
maintenance-ci/views/9.x.tempest.yaml [new file with mode: 0644]
maintenance-ci/views/9.x.yaml [new file with mode: 0644]

diff --git a/maintenance-ci/common/data/mos-slave.yml b/maintenance-ci/common/data/mos-slave.yml
new file mode 100644 (file)
index 0000000..5896e46
--- /dev/null
@@ -0,0 +1,90 @@
+
+heat_template_version: 2017-09-01
+
+parameters:
+  key_name:
+    type: string
+    description: Name of keypair to assign to servers
+    default: maintenance-ci-public-key
+  image:
+    type: string
+    description: Name of image to use for servers
+    default: xenial-server-cloudimg-amd64-qcow
+  flavor:
+    type: string
+    description: Flavor to use for servers
+  private_net:
+    type: string
+    description: >
+      ID or name of public network for which floating IP addresses will be allocated
+    default: maintenance-ci-network
+  private_subnet:
+    type: string
+    default: maintenance-ci-subnet
+    description: Id of the private sub network for the compute server
+  public_net:
+    type: string
+    default: public
+    description: Id of the public network for the compute server
+  jenkins_labels:
+    type: string
+    default: ''
+    description: List of labels for jenkins swarm agent separated by whitespace
+
+resources:
+
+  wait_condition:
+    type: OS::Heat::WaitCondition
+    properties:
+      handle: {get_resource: wait_handle}
+      count: 1
+      timeout: 300
+
+  wait_handle:
+    type: OS::Heat::WaitConditionHandle
+
+  public_port:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_param: private_net }
+      fixed_ips:
+      - subnet_id: { get_param: private_subnet }
+      security_groups:
+      - dc56d304-e75e-437a-8ef5-656f9bfcd2a0
+
+  floating_ip:
+    type: OS::Neutron::FloatingIP
+    properties:
+      floating_network_id: { get_param: public_net }
+      port_id: { get_resource: public_port }
+
+  node:
+    type: OS::Nova::Server
+    properties:
+      image: { get_param: image }
+      availability_zone: nova
+      flavor: { get_param: flavor }
+      key_name: { get_param: key_name }
+      networks:
+        - port: { get_resource: public_port }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            mkdir -p /etc/jenkins-agent/
+            echo "FLAVOR LABELS" > /etc/jenkins-agent/labels
+            echo "127.0.0.1 $(hostname)" >> /etc/hosts
+            echo "FLOATING" > /etc/jenkins-agent/description
+            service jenkins-swarm-agent restart
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+           FLAVOR: {get_param: flavor}
+           LABELS: {get_param: jenkins_labels}
+           wc_notify: { get_attr: [wait_handle, curl_cli] }
+           FLOATING: { get_attr: [ floating_ip, floating_ip_address ] }
+
+
+outputs:
+  floating_ip:
+      description: Floating IP
+      value: { get_attr: [ floating_ip, floating_ip_address ] }
index 7334d8554ea836505385baf2478ee9511ec4f299..5a0e8b3bd7ee0b4e163fefbd77a1c1dd32d4d350 100644 (file)
@@ -1,7 +1,6 @@
 - job:
     name: 'build-swarm-image'
-    description: |
-            Create given heat stack on internal cloud in maintenance-team tenant
+    description: "Create given heat stack on internal cloud in maintenance-team tenant"
 
     concurrent: false
     node: 'image-builder'
         description: 'Number of gerrit review'
 
     scm:
-        - git:
-            url: 'https://review.fuel-infra.org/tools/sustaining/'
-            branches:
-                - origin/master
+    - git:
+        url: 'https://review.fuel-infra.org/tools/sustaining/'
+        branches:
+            - origin/master
 
     wrappers:
     - timestamps
     - openstack-creds
     - credentials-binding:
         - username-password-separated:
-              credential-id: maintenance-ci-robot-password
-              username: JJB_USER
-              password: JJB_PASS
+            credential-id: maintenance-ci-robot-password
+            username: JJB_USER
+            password: JJB_PASS
 
     - timeout:
         fail: true
similarity index 60%
rename from maintenance-ci/common/jobs/delete_stack.yaml
rename to maintenance-ci/common/jobs/delete-stack.yaml
index 9b612d1019c5cb990d4e5ee445cb2e3c7577c1b3..2a1e088d64b92c16ddb76be72dd060aa825d8834 100644 (file)
@@ -1,7 +1,7 @@
 - job:
     name: 'delete-heat-stack'
     description: |
-            Delete given heat stack on internal cloud from maintenance-team tenant
+        Delete given heat stack on internal cloud from maintenance-team tenant
 
     concurrent: false
     node: 'jenkins-master'
         name: STACK_NAME
         default: ""
         description: |
-            Full name of pending for deletion stack.
-            If not given - STACK_PREFIX will be proceed
+          Full name of pending for deletion stack.
+          If not given - STACK_PREFIX will be proceed
     - string:
         name: STACK_PREFIX
         description: |
-            All stacks named with prefix on name's start will be deleted.
-            Used only if STACK_NAME is not defined
+          All stacks named with prefix on name's start will be deleted.
+          Used only if STACK_NAME is not defined
         default: ""
 
 
index f3fcb64d1813bd30d7a7dce06cd4173325d4d3d9..41d66f3f917ff4f1d1fef37316f610725c9989d1 100644 (file)
 - job:
     name: 'deploy-jenkins-swarm'
     description: |
-            Create given jenkins slaves on internal cloud in maintenance-team tenant
+        Create given jenkins slaves on internal cloud in maintenance-team tenant
 
     concurrent: false
     node: 'jenkins-master'
 
     parameters:
-    - string:
-        name: HEAT_STACK_YAML
-        description: "Stack yaml file"
-        default: "maintenance-ci/common/data/jenkins-slave.yml"
-    - string:
-        name: STACK_PREFIX
-        description: "Stack prefix"
-        default: "swarm-slave"
-    - string:
-        name: MOS_BASE_NODE_COUNT
-        default: "0"
-    - string:
-        name: MOS_HUGE_NODE_COUNT
-        default: "0"
-    - string:
-        name: MOS_TEMPEST_NODE_COUNT
-        default: "0"
-
-    - string:
-          name: IMAGE_NAME
-          default: xenial-server-cloudimg-amd64-qcow
-    - string:
-          name: JENKINS_LABELS
-          default: ''
-
-    - string:
-          name: CUSTOM_FLAVOR_NAME
-          default: "0"
-    - string:
-          name: CUSTOM_FLAVOR_JENKINS_LABELS
-          default: ""
-    - string:
-          name: CUSTOM_FLAVOR_NODE_COUNT
-          default: "0"
+    - mos-jenkins-swarm-params
 
     scm:
-        - git:
-            url: 'https://review.fuel-infra.org/tools/sustaining/'
-            branches:
-                - origin/master
+    - git:
+        url: 'https://review.fuel-infra.org/tools/sustaining/'
+        branches:
+            - origin/master
 
     wrappers:
-        - timestamps
-        - openstack-creds
-        - timeout:
-            fail: true
-            timeout: 30
+    - timestamps
+    - openstack-creds
+    - timeout:
+        fail: true
+        timeout: 30
 
     builders:
-    - shell:
-        !include-raw: common/scripts/deploy_jenkins_swarm.sh
+    - conditional-step:
+        condition-kind: num-comp
+        lhs: $MOS_BASE_NODE_COUNT
+        rhs: 0
+        comparator: greater-than
+        steps:
+        - trigger-builds:
+            - project: "deploy-heat-stack"
+              block: true
+              parameter-factories:
+              - factory: counterbuild
+                from: 1
+                to: $MOS_BASE_NODE_COUNT
+                step: 1
+              predefined-parameters: |
+                    HEAT_STACK_YAML=${HEAT_STACK_YAML}
+                    STACK_PREFIX=mos-slave
+                    FLAVOR_NAME=mos.fuel.base
+                    IMAGE_NAME=${IMAGE_NAME}
+                    GERRIT_REVIEW=${GERRIT_REVIEW}
+    - conditional-step:
+        condition-kind: num-comp
+        lhs: $MOS_HUGE_NODE_COUNT
+        rhs: 0
+        comparator: greater-than
+        steps:
+        - trigger-builds:
+            - project: "deploy-heat-stack"
+              block: true
+              parameter-factories:
+              - factory: counterbuild
+                from: 1
+                to: $MOS_HUGE_NODE_COUNT
+                step: 1
+              predefined-parameters: |
+                    HEAT_STACK_YAML=${HEAT_STACK_YAML}
+                    STACK_PREFIX=mos-slave
+                    FLAVOR_NAME=mos.fuel.huge
+                    IMAGE_NAME=${IMAGE_NAME}
+                    GERRIT_REVIEW=${GERRIT_REVIEW}
+    - conditional-step:
+        condition-kind: num-comp
+        lhs: $MOS_TEMPEST_NODE_COUNT
+        rhs: 0
+        comparator: greater-than
+        steps:
+        - trigger-builds:
+            - project: "deploy-heat-stack"
+              block: true
+              parameter-factories:
+                - factory: counterbuild
+                  from: 1
+                  to: $MOS_TEMPEST_NODE_COUNT
+                  step: 1
+              predefined-parameters: |
+                    HEAT_STACK_YAML=${HEAT_STACK_YAML}
+                    STACK_PREFIX=mos-slave
+                    FLAVOR_NAME=mos.tempest
+                    IMAGE_NAME=${IMAGE_NAME}
+                    GERRIT_REVIEW=${GERRIT_REVIEW}
+    - conditional-step:
+        condition-kind: num-comp
+        lhs: $CUSTOM_FLAVOR_NODE_COUNT
+        rhs: 0
+        comparator: greater-than
+        steps:
+        - trigger-builds:
+            - project: "deploy-heat-stack"
+              block: true
+              parameter-factories:
+              - factory: counterbuild
+                from: 1
+                to: $CUSTOM_FLAVOR_NODE_COUNT
+                step: 1
+              predefined-parameters: |
+                  HEAT_STACK_YAML=${CUSTOM_HEAT_STACK_YAML}
+                  STACK_PREFIX=mos-slave
+                  FLAVOR_NAME=${CUSTOM_FLAVOR_NAME}
+                  JENKINS_LABELS=${CUSTOM_FLAVOR_JENKINS_LABELS}
+                  IMAGE_NAME=${IMAGE_NAME}
+                  GERRIT_REVIEW=${GERRIT_REVIEW}
index c09a58b4363bb39d3bd15e9015529dbd0daa998f..882269c3df63a6b779dc6ee020c1847a2c49472d 100644 (file)
         default: "dev.share"
     - string:
         name: IMAGE_NAME
-        default: xenial-server-cloudimg-amd64-qcow
+        default: maintenance-ci-base-slave
     - string:
         name: JENKINS_LABELS
         default: ''
+    - string:
+        name: GERRIT_REVIEW
+        description: 'Number of gerrit review'
 
     scm:
     - git:
         url: 'https://review.fuel-infra.org/tools/sustaining/'
         branches:
-        - origin/master
+            - origin/master
 
     wrappers:
     - timestamps
index 2e54cccf69f2bc713c0ae011a92e25f37eaaebca..05afaa60e2bfb28a8143324452db4d8631947549 100644 (file)
@@ -1,7 +1,7 @@
 - job:
     name: 'multijob-build-image'
     description: |
-      Build image for future use
+        Build image for future use
 
     concurrent: false
     node: 'jenkins-master'
@@ -20,8 +20,8 @@
     - choice:
         name: UPDATE_SCRIPT
         choices:
-        - "maintenance-ci/common/scripts/build_base_swarm_slave_image.sh"
-        - "maintenance-ci/common/scripts/build_mos_swarm_slave_image.sh"
+            - "maintenance-ci/common/scripts/build_base_swarm_slave_image.sh"
+            - "maintenance-ci/common/scripts/build_mos_swarm_slave_image.sh"
     - string:
         name: CUSTOM_UPDATE_SCRIPT
         description: "Overwrite UPDATE_SCRIPT if needed"
 
     builders:
     - trigger-builds:
-      - project: "deploy-heat-stack"
-        predefined-parameters: |
-          HEAT_STACK_YAML=maintenance-ci/common/data/jenkins-slave.yml
-          STACK_PREFIX=image-builder
-          FLAVOR_NAME=dev.cmn
-          JENKINS_LABELS=image-builder
-          IMAGE_NAME=${DEPLOY_IMAGE_NAME}
-          GERRIT_REVIEW=${GERRIT_REVIEW}
-        block: true
+        - project: "deploy-heat-stack"
+          predefined-parameters: |
+            HEAT_STACK_YAML=maintenance-ci/common/data/jenkins-slave.yml
+            STACK_PREFIX=image-builder
+            FLAVOR_NAME=dev.cmn
+            JENKINS_LABELS=image-builder
+            IMAGE_NAME=${DEPLOY_IMAGE_NAME}
+            GERRIT_REVIEW=${GERRIT_REVIEW}
+          block: true
     - trigger-builds:
-      - project: "build-swarm-image"
-        block: true
-        predefined-parameters: |
-          IMAGE_NAME=${BUILD_IMAGE_NAME}
-          GERRIT_REVIEW=${GERRIT_REVIEW}
-          TEST_AFTER_BUILD=${TEST_AFTER_BUILD}
-          UPDATE_SCRIPT=${UPDATE_SCRIPT}
-          CUSTOM_UPDATE_SCRIPT=${CUSTOM_UPDATE_SCRIPT}
+        - project: "build-swarm-image"
+          block: true
+          predefined-parameters: |
+            IMAGE_NAME=${BUILD_IMAGE_NAME}
+            GERRIT_REVIEW=${GERRIT_REVIEW}
+            TEST_AFTER_BUILD=${TEST_AFTER_BUILD}
+            UPDATE_SCRIPT=${UPDATE_SCRIPT}
+            CUSTOM_UPDATE_SCRIPT=${CUSTOM_UPDATE_SCRIPT}
     - trigger-builds:
-      - project: "delete-heat-stack"
-        predefined-parameters: |
-          STACK_PREFIX=image-builder
-        block: true
+        - project: "delete-heat-stack"
+          predefined-parameters: |
+            STACK_PREFIX=image-builder
+          block: true
 
 
diff --git a/maintenance-ci/common/jobs/update-jenkins-jobs.yaml b/maintenance-ci/common/jobs/update-jenkins-jobs.yaml
new file mode 100644 (file)
index 0000000..b3589df
--- /dev/null
@@ -0,0 +1,62 @@
+- job:
+    name: 'update-jenkins-jobs'
+    description: |
+      <p>Update jenkins jobs configuration</p>
+      <p>Requires python-tox package and user credentials stored as JJB_USER and JJB_PASS using Jenkins Global Passwords feature</p>
+
+
+    concurrent: false
+    node: 'jenkins-master'
+
+    build-discarder:
+        numToKeep: '5'
+
+    parameters:
+    - string:
+          name: GERRIT_REVIEW
+          description: 'Number of gerrit review'
+
+    scm:
+    - git:
+        url: 'https://review.fuel-infra.org/tools/sustaining/'
+        branches:
+            - origin/master
+
+    #    triggers:
+    #    - timed: 'H * * * *'
+    #    - gerrit:
+    #        trigger-on:
+    #        - change-merged-event
+    #        projects:
+    #        - project-compare-type: PLAIN
+    #          project-pattern: 'fuel-infra/jenkins-jobs'
+    #          branches:
+    #          - branch-compare-type: PLAIN
+    #            branch-pattern: 'master'
+    #          file-paths:
+    #          - compare-type: ANT
+    #            pattern: 'common/**'
+    #          - compare-type: ANT
+    #            pattern: 'servers/{ci-name}/**'
+
+    wrappers:
+    - timestamps
+    - credentials-binding:
+        - username-password-separated:
+            credential-id: maintenance-ci-robot-password
+            username: JJB_USER
+            password: JJB_PASS
+    - timeout:
+        fail: true
+        timeout: 30
+
+    builders:
+    - shell:
+        !include-raw: common/scripts/update_jenkins_jobs.sh
+
+    publishers:
+    - post-tasks:
+        - matches:
+            - log-text: '.'
+              escalate-status: true
+              script: !include-raw: common/scripts/update_jenkins_cleanup.sh
\ No newline at end of file
diff --git a/maintenance-ci/common/jobs/update_jenkins_jobs.yaml b/maintenance-ci/common/jobs/update_jenkins_jobs.yaml
deleted file mode 100644 (file)
index 7bdd713..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-- job:
-    name: 'update-jenkins-jobs'
-    description: |
-      <p>Update jenkins jobs configuration</p>
-      <p>Requires python-tox package and user credentials stored as JJB_USER and JJB_PASS using Jenkins Global Passwords feature</p>
-
-
-    concurrent: false
-    node: 'jenkins-master'
-
-    parameters:
-    - string:
-        name: GERRIT_REVIEW
-        description: 'Number of gerrit review'
-
-    scm:
-    - git:
-        remotes:
-          - gerrit:
-              url: 'https://review.fuel-infra.org/tools/sustaining/'
-        branches:
-          - master
-        choosing-strategy: default
-
-#    triggers:
-#    - timed: 'H * * * *'
-#    - gerrit:
-#        trigger-on:
-#        - change-merged-event
-#        projects:
-#        - project-compare-type: PLAIN
-#          project-pattern: 'fuel-infra/jenkins-jobs'
-#          branches:
-#          - branch-compare-type: PLAIN
-#            branch-pattern: 'master'
-#          file-paths:
-#          - compare-type: ANT
-#            pattern: 'common/**'
-#          - compare-type: ANT
-#            pattern: 'servers/{ci-name}/**'
-
-    wrappers:
-    - timestamps
-    - credentials-binding:
-        - username-password-separated:
-            credential-id: maintenance-ci-robot-password
-            username: JJB_USER
-            password: JJB_PASS
-    - timeout:
-        fail: true
-        timeout: 30
-
-    builders:
-    - shell:
-        !include-raw: common/scripts/update_jenkins_jobs.sh
-
-    publishers:
-    - post-tasks:
-      - matches:
-        - log-text: '.'
-        escalate-status: true
-        script: !include-raw: common/scripts/update_jenkins_cleanup.sh
\ No newline at end of file
diff --git a/maintenance-ci/common/macroses/inject-text-parameter.yaml b/maintenance-ci/common/macroses/inject-text-parameter.yaml
new file mode 100644 (file)
index 0000000..df0eec7
--- /dev/null
@@ -0,0 +1,10 @@
+- builder:
+    name: inject-text-parameter
+    builders:
+    - shell: |
+        #!/bin/bash
+        set -e
+        echo {properties-content} | tr " " "\n" > "inject.text.sh"
+
+    - inject:
+        properties-file: 'inject.text.sh'
\ No newline at end of file
diff --git a/maintenance-ci/common/macroses/mos-jenkins-swarm-params.yaml b/maintenance-ci/common/macroses/mos-jenkins-swarm-params.yaml
new file mode 100644 (file)
index 0000000..16eed54
--- /dev/null
@@ -0,0 +1,41 @@
+- parameter:
+    name: mos-jenkins-swarm-params
+
+    parameters:
+    - string:
+        name: HEAT_STACK_YAML
+        description: "Stack yaml file"
+        default: "maintenance-ci/common/data/jenkins-slave.yml"
+    - string:
+        name: STACK_PREFIX
+        description: "Stack prefix"
+        default: "swarm-slave"
+    - string:
+        name: MOS_BASE_NODE_COUNT
+        default: "0"
+    - string:
+        name: MOS_HUGE_NODE_COUNT
+        default: "0"
+    - string:
+        name: MOS_TEMPEST_NODE_COUNT
+        default: "0"
+
+    - string:
+        name: IMAGE_NAME
+        default: maintenance-ci-mos-image
+    - string:
+        name: JENKINS_LABELS
+        default: ''
+
+    - string:
+        name: CUSTOM_FLAVOR_NAME
+        default: ""
+    - string:
+        name: CUSTOM_HEAT_STACK_YAML
+        default: ""
+    - string:
+        name: CUSTOM_FLAVOR_JENKINS_LABELS
+        default: ""
+    - string:
+        name: CUSTOM_FLAVOR_NODE_COUNT
+        default: "0"
\ No newline at end of file
index e4c69df7b753c4bac52968b49ca1f8f9f9299ca3..2991fa6dc0d37842752582ca4ad9b60832468d9d 100644 (file)
@@ -1,11 +1,11 @@
 - wrapper:
     name: openstack-creds
     wrappers:
-        - credentials-binding:
-            - file:
-                credential-id: maintenance-ci-openrc-password-free
-                variable: OPENRC_FILE
-            - username-password-separated:
-                credential-id: maintenance-ci-robot-password
-                username: OS_USERNAME
-                password: OS_PASSWORD
\ No newline at end of file
+    - credentials-binding:
+        - file:
+            credential-id: maintenance-ci-openrc-password-free
+            variable: OPENRC_FILE
+        - username-password-separated:
+            credential-id: maintenance-ci-robot-password
+            username: OS_USERNAME
+            password: OS_PASSWORD
\ No newline at end of file
index 0f48202b7cf05094da8b0e3875fc1d37a66bc4ae..bfec3ac6292e99a4d8276f3a684353e5e2c1c483 100755 (executable)
@@ -2,6 +2,11 @@
 
 set -ex
 
+if [ ! -z ${GERRIT_REVIEW} ] ; then
+refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"')
+git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD
+fi
+
 OPENSTACK_CLIENTS_VENV="${OPENSTACK_CLIENTS_VENV:-/home/jenkins/venv-openstack-clients}"
 
 if [[ ! -d "${OPENSTACK_CLIENTS_VENV}" ]] ; then
@@ -13,14 +18,15 @@ fi
 
 parameter_string=""
 if [[ ! -z "${FLAVOR_NAME}" ]] ; then
-  parameter_string="$parameter_string --parameter \"flavor=${FLAVOR_NAME}\""
+  parameter_string="flavor=${FLAVOR_NAME};$parameter_string"
 fi
 if [[ ! -z "${IMAGE_NAME}" ]] ; then
-  parameter_string="$parameter_string --parameter \"image=${IMAGE_NAME}\""
+  parameter_string="image=${IMAGE_NAME};$parameter_string"
 fi
 if [[ ! -z "${JENKINS_LABELS}" ]] ; then
-  parameter_string="$parameter_string --parameter \"jenkins_labels=${JENKINS_LABELS}\""
+  parameter_string="jenkins_labels=${JENKINS_LABEL};$parameter_string"
 fi
+parameter_string=$(sed 's/;$//' <<< $parameter_string)
 
 # MAC OS compatibility, for manual usage
 if command -v md5sum ; then
@@ -35,7 +41,7 @@ set +x
 source "${OPENSTACK_CLIENTS_VENV}"/bin/activate
 set -x
   source "${OPENRC_FILE?}"
-  echo "openstack stack create --wait -t ${HEAT_STACK_YAML} ${parameter_string} ${STACK_NAME}" | bash -
+  openstack stack create --wait -t ${HEAT_STACK_YAML} --parameter "${parameter_string}" ${STACK_NAME}
   openstack stack output show "${STACK_NAME}" --all
   cat >stack_data.sh <<EOF
 STACK_NAME=${STACK_NAME}
index 313a75bb8d1248a6b3ffdc41c8ee18f79afc4d7c..3967cc810fa36c1388f007b98962713bc207cf33 100755 (executable)
@@ -2,6 +2,11 @@
 
 set -ex
 
+if [ ! -z ${GERRIT_REVIEW} ] ; then
+refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"')
+git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD
+fi
+
 OPENSTACK_CLIENTS_VENV="${OPENSTACK_CLIENTS_VENV:-/home/jenkins/venv-openstack-clients}"
 
 if [[ ! -d "${OPENSTACK_CLIENTS_VENV}" ]] ; then
index ef3906587ca8e7c73fc623b57ffa2701e282b10c..dedbe4a5cbc715d18b95310244445adf5eab749f 100644 (file)
@@ -31,5 +31,4 @@ param_order_from_yaml=true
 EOF
 
 jenkins-jobs --conf "${CONFIG_PATH}/jenkins_jobs.ini" update -x common/data "common:mos:mcp"
-
 popd
diff --git a/maintenance-ci/mos/.keep b/maintenance-ci/mos/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/maintenance-ci/mos/data/8.0-iso b/maintenance-ci/mos/data/8.0-iso
new file mode 100644 (file)
index 0000000..66d8d98
--- /dev/null
@@ -0,0 +1 @@
+magnet:?xt=urn:btih:4709616bca3e570a951c30b7cf9ffeb2c0359f5c&dn=MirantisOpenStack-8.0.iso&tr=http%3A%2F%2Ftracker01-bud.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-scc.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-msk.infra.mirantis.net%3A8080%2Fannounce&ws=http%3A%2F%2Fvault.infra.mirantis.net%2FMirantisOpenStack-8.0.iso
\ No newline at end of file
diff --git a/maintenance-ci/mos/data/9.0-iso b/maintenance-ci/mos/data/9.0-iso
new file mode 100644 (file)
index 0000000..6923d20
--- /dev/null
@@ -0,0 +1 @@
+magnet:?xt=urn:btih:bfec808dd71ff42c5613a3527733d9012bb1fabc&dn=MirantisOpenStack-9.0.iso&tr=http%3A%2F%2Ftracker01-bud.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-scc.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-msk.infra.mirantis.net%3A8080%2Fannounce&ws=http%3A%2F%2Fvault.infra.mirantis.net%2FMirantisOpenStack-9.0.iso
\ No newline at end of file
diff --git a/maintenance-ci/mos/jobs/9.x.swarm.micro.runner.yaml b/maintenance-ci/mos/jobs/9.x.swarm.micro.runner.yaml
new file mode 100644 (file)
index 0000000..c633e76
--- /dev/null
@@ -0,0 +1,50 @@
+- job:
+    name: '9.x.swarm.micro.runner'
+    description: 'Run small set of system tests (debug purpose mainly)'
+
+    concurrent: false
+    project-type: multijob
+    node: 'jenkins-master'
+
+    properties:
+    - heavy-job:
+        weight: 1
+
+    parameters:
+    - bool:
+        name: PREPARE_SLAVE
+        default: true
+        description: "Launch jenkins slaves?"
+    - 9x-systest-params
+    - mos-jenkins-swarm-params
+
+    wrappers:
+    - timeout:
+        fail: true
+        timeout: 1800
+
+    builders:
+    - write-description:
+        description-string: $CUSTOM_VERSION
+
+    - conditional-step:
+        condition-kind: boolean-expression
+        condition-expression: $PREPARE_SLAVE
+        on-evaluation-failure: dont-run
+        steps:
+        - trigger-builds:
+            - project: "deploy-jenkins-swarm"
+              current-parameters: true
+              block: true
+
+    - multijob:
+        name: 'Run system tests'
+        condition: COMPLETED
+        projects:
+        - name: '9.x.bvt_2'
+          current-parameters: true
+          kill-phase-on: NEVER
+
+    publishers:
+    - description-setter:
+        regexp: "'Description string: (.*)'"
diff --git a/maintenance-ci/mos/jobs/9.x.swarm.runner.yaml b/maintenance-ci/mos/jobs/9.x.swarm.runner.yaml
new file mode 100644 (file)
index 0000000..62a01da
--- /dev/null
@@ -0,0 +1,268 @@
+#- job:
+#  name: '9.x.swarm.runner'
+#  description: 'Run all system tests'
+#
+#  concurrent: false
+#  project-type: multijob
+#  node: 'jenkins-master'
+#
+#  properties:
+#  - heavy-job:
+#      weight: 1
+#
+#  parameters:
+#  - bool:
+#      name: PREPARE_SWARM
+#      default: true
+#      description: "Should I run new slaves?"
+#  - 9x-systest-params
+#  - mos-jenkins-swarm-params
+#
+#  wrappers:
+#  - timeout:
+#      fail: true
+#      timeout: 1800
+#
+#  builders:
+#
+#  - write-description:
+#      description-string: $CUSTOM_VERSION
+#
+#  conditional-step:
+#    condition-kind: boolean-expression
+#    on-evaluation-failure: dont-run
+#    steps:
+#    - trigger-builds:
+#      - project: "deploy-jenkins-swarm"
+#        current-parameters: true
+#
+#  - multijob:
+#    name: 'Run system tests'
+#    condition: COMPLETED
+#    projects:
+#    # Ubuntu
+#    - name: '9.x.thread_1'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.jumbo_frames'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ceph_ha_one_controller'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.one_controller_actions'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.multirole'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.thread_3'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.thread_7'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.bonding_ha'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.bonding_ha_one_controller'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.cluster_actions'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.cluster_actions_ha'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.controller_replacement'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.cic_maintenance_mode'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.offloading'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.filling_root'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_tun'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_tun_scale'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_public'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_destructive'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_destructive_vlan'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_neutron_destructive_vxlan'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.command_line'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.logrotate'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ha_destructive_ceph_neutron'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.huge_ha_neutron'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.reduced_footprint'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.repeatable_image_based'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    #- name: '9.x.known_issues'
+#    #  current-parameters: true
+#    #  kill-phase-on: NEVER
+#    - name: '9.x.plugins.fuel_plugin_example'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.plugins.install_plugin_after_cluster_create'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.plugins.detach-rabbitmq-ci-group'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.plugins.thread_separate_haproxy'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.fuel_plugin_reboot'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.fuel_plugin_vip_reservation'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.services_ha'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.services_ha.ceilometer'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.services_ha_one_controller'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.thread_non_func_1'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.thread_usb'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.custom_hostname'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.fuel_master_migrate'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.repetitive_restart'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ready_node_reinstallation'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.error_node_reinstallation'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.bvt_ubuntu_bootstrap'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.full_cluster_reinstallation'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.network_templates'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ironic_deploy_swift'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ironic_deploy_ceph'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.services_reconfiguration_thread_1'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.services_reconfiguration_thread_2'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.cgroup_ha'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.multiracks_2'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.numa_cpu_pinning'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.support_dpdk'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.custom_graph'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.support_dpdk_bond'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.system_test.deploy_centos_master'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.deploy_multipath'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.test_ibp'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.test_bdd'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.support_hugepages'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.smoke_test_configdb'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.unlock_settings_tab_states'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.unlock_settings_tab'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.public_api'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.env_customizations_check'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.graph_extension'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.add_updated_node_to_environment'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ovs_firewall'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.ovs_firewall_with_dpdk'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.test_tags'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#    - name: '9.x.multiqueue_base_check'
+#      current-parameters: true
+#      kill-phase-on: NEVER
+#  publishers:
+#  - description-setter:
+#      regexp: "'Description string: (.*)'"
diff --git a/maintenance-ci/mos/jobs/9.x.swarm.tests.yaml b/maintenance-ci/mos/jobs/9.x.swarm.tests.yaml
new file mode 100644 (file)
index 0000000..b07c1e8
--- /dev/null
@@ -0,0 +1,20 @@
+- project:
+    name: '9.x swarm tests'
+    swarm-test/repobranch: 'origin/stable/mitaka'
+    swarm-test/reponame: 'fuel-qa'
+    swarm-test/venvpath: '/home/jenkins/qa-venv-9.x'
+    swarm-test/default_pool: '10.109.0.0/16:24'
+    description: '9.1 swarm test group' # fixme!
+    swarm-test/node: 'mos.fuel.base'
+    swarm-test/timeout: '480'
+
+    swarm-test/job-weight: '12'
+
+    swarm-test/logrotate/artifactNumToKeep: 5
+
+    swarm-test-plugins/node: 'mos.fuel.base'
+
+    jobs:
+    - mos/templates/swarm-test:
+        testgroup:
+        - bvt_2
\ No newline at end of file
diff --git a/maintenance-ci/mos/jobs/9.x.test-reports.yaml b/maintenance-ci/mos/jobs/9.x.test-reports.yaml
new file mode 100644 (file)
index 0000000..28ccdad
--- /dev/null
@@ -0,0 +1,18 @@
+- project:
+    name: patching-ci/testrail-reports-9.x
+    testrail_reporter/logrotate/artifactDaysToKeep: 14
+    testrail_reporter/logrotate/artifactNumToKeep: -1
+    testrail_reporter/logrotate/daysToKeep: 90
+    testrail_reporter/logrotate/numToKeep: 100
+    testrail_reporter/node: 'mos.fuel.base'
+
+    jobs:
+    - mos/templates/test-report-9.x:
+        version:
+        - 9.x: # swarm
+            testrail_reporter/venv_path: '/home/jenkins/qa-venv-9.x'
+            testrail_reporter/fuel-qa-branch: stable/mitaka
+            testrail_reporter/testrail_milestone: '9.2'
+            testrail_reporter/launchpad_milestone: '9.2'
+            testrail_reporter/test_runner_job: '9.x.swarm.runner'
+            testrail_reporter/testrail_suite: '[IC-US][9.x] Swarm'
\ No newline at end of file
diff --git a/maintenance-ci/mos/jobs/snapshot.yaml b/maintenance-ci/mos/jobs/snapshot.yaml
new file mode 100644 (file)
index 0000000..f176278
--- /dev/null
@@ -0,0 +1,26 @@
+- project:
+    name: maintenance-snapshots.params
+
+#    timer: '0 0,6,12,18 * * *'
+    jobs:
+      - '{version}.snapshot.params':
+          version: 9.x
+          magnet-link: 'magnet:?xt=urn:btih:bfec808dd71ff42c5613a3527733d9012bb1fabc&dn=MirantisOpenStack-9.0.iso&tr=http%3A%2F%2Ftracker01-bud.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-scc.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-msk.infra.mirantis.net%3A8080%2Fannounce&ws=http%3A%2F%2Fvault.infra.mirantis.net%2FMirantisOpenStack-9.0.iso'
+          src-centos-mirror: 'pkgs/snapshots/centos-7.6.1810-latest.target.txt'
+          src-mos-ubuntu-mirror: 'mos-repos/ubuntu/snapshots/9.0-latest.target.txt'
+          src-mos-centos-repos-prefix: 'mos-repos/centos/mos9.0-centos7/snapshots'
+
+      - '{version}.snapshot.params':
+          version: 8.0
+          magnet-link: 'magnet:?xt=urn:btih:4709616bca3e570a951c30b7cf9ffeb2c0359f5c&dn=MirantisOpenStack-8.0.iso&tr=http%3A%2F%2Ftracker01-bud.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-scc.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-msk.infra.mirantis.net%3A8080%2Fannounce&ws=http%3A%2F%2Fvault.infra.mirantis.net%2FMirantisOpenStack-8.0.iso'
+          src-centos-mirror: 'pkgs/snapshots/centos-7.3.1611-latest.target.txt'
+          src-mos-ubuntu-mirror: 'mos-repos/ubuntu/snapshots/8.0-latest.target.txt'
+          src-mos-centos-repos-prefix: 'mos-repos/centos/mos8.0-centos7-fuel/snapshots'
+          src-centos-security-proposed: 'http://pkg-updates.fuel-infra.org/centos7/'
+
+      - '{version}.snapshot.params':
+          version: 7.0
+          magnet-link: 'magnet:?xt=urn:btih:21b4d46c9f1cec02e336b1f9771d4f7c27ec724b&dn=MirantisOpenStack-7.0.iso&tr=http%3A%2F%2Ftracker01-bud.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-scc.infra.mirantis.net%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker01-msk.infra.mirantis.net%3A8080%2Fannounce&ws=http%3A%2F%2Fvault.infra.mirantis.net%2FMirantisOpenStack-7.0.iso'
+          src-mos-ubuntu-mirror: 'mos-repos/ubuntu/snapshots/7.0-latest.target.txt'
+          src-mos-centos-repos-prefix: 'mos-repos/centos/mos7.0-centos6-fuel/snapshots'
+          src-centos-security-proposed: 'http://pkg-updates.fuel-infra.org/centos6/'
diff --git a/maintenance-ci/mos/macroses/9x-run-sys-test.yaml b/maintenance-ci/mos/macroses/9x-run-sys-test.yaml
new file mode 100644 (file)
index 0000000..5d12e16
--- /dev/null
@@ -0,0 +1,7 @@
+- builder:
+    name: 9x-run-sys-test
+    builders:
+    - guess-mirror
+    - 9x-systest-repos-parsing
+    - shell:
+        !include-raw: '../scripts/fuel_qa_launch_test.sh'
\ No newline at end of file
diff --git a/maintenance-ci/mos/macroses/9x-systest-params.yaml b/maintenance-ci/mos/macroses/9x-systest-params.yaml
new file mode 100644 (file)
index 0000000..182170f
--- /dev/null
@@ -0,0 +1,69 @@
+- parameter:
+    name: 9x-systest-params
+
+    parameters:
+    - label:
+        name: NODE_LABELS
+        desctiption: "Label where to run job; node name are acceptable too"
+        default: '{swarm-test/node}'
+    - bool:
+        name: DELETE_ENV_BEFORE_RUN
+        default: false
+    - string:
+        name: SNAPSHOT_PARAMS_ID
+        default: lastSuccessfulBuild
+        description: |
+          Take from https://patching-ci.infra.mirantis.net/job/9.x.snapshot.params/
+          for last build: lastSuccessfulBuild
+          Parameters that marked with '*snapshot.params' not been used and can be ommited if this parameter provided
+
+    - string:
+        name: CUSTOM_VERSION
+        description: |
+          Custom version for test rails reporting.
+          Normally should be inserted from snapshot job
+        default: 9.x MU
+
+    - string:
+        name: SNAPSHOT_TIMESTAMP_OVERWRITE
+        description: |
+          Timestamp for test rails reporting.
+          Normally should be inserted from snapshot job
+
+    - string:
+        name: MAGNET_LINK_OVERWRITE
+        description: "Which ISO to use in tests"
+        default: !include-raw: ../data/9.0-iso
+
+    - string:
+        name: FUEL_QA_COMMIT
+        description: "fuel-qa commit"
+        default: stable/mitaka
+
+
+    # section for mos rpm repos
+    - text:
+        name: MOS_MIRROR_OVERWRITES
+        description: "Set of variables to inject to job; add new parameters if needed for run"
+        default: |
+            ENABLE_MOS_CENTOS_OS=true
+            ENABLE_MOS_CENTOS_PROPOSED=true
+            ENABLE_MOS_CENTOS_UPDATES=true
+            ENABLE_MOS_CENTOS_SECURITY=true
+            ENABLE_MOS_CENTOS_HOLDBACK=true
+            ENABLE_MOS_CENTOS_HOTFIX=false
+            MOS_CENTOS_OS_MIRROR_ID_OVERWRITE=
+            MOS_CENTOS_PROPOSED_MIRROR_ID_OVERWRITE=
+            MOS_CENTOS_UPDATES_MIRROR_ID_OVERWRITE=
+            MOS_CENTOS_SECURITY_MIRROR_ID_OVERWRITE=
+            MOS_CENTOS_HOLDBACK_MIRROR_ID_OVERWRITE=
+            MOS_CENTOS_HOTFIX_MIRROR_ID_OVERWRITE=
+            #
+            MOS_UBUNTU_MIRROR_ID_OVERWRITE=
+            ENABLE_MOS_UBUNTU_PROPOSED=true
+            ENABLE_MOS_UBUNTU_UPDATES=true
+            ENABLE_MOS_UBUNTU_SECURITY=true
+            ENABLE_MOS_UBUNTU_HOLDBACK=true
+            ENABLE_MOS_UBUNTU_HOTFIX=false
+            UBUNTU_MIRROR_ID_OVERWRITE=
+            CENTOS_MIRROR_ID_OVERWRITE=
diff --git a/maintenance-ci/mos/macroses/9x-systest-repos-parsing.yaml b/maintenance-ci/mos/macroses/9x-systest-repos-parsing.yaml
new file mode 100644 (file)
index 0000000..4975b85
--- /dev/null
@@ -0,0 +1,8 @@
+- builder:
+    name: 9x-systest-repos-parsing
+
+    builders:
+      - shell:
+          !include-raw: '../scripts/systest_repos_parsing.sh'
+      - inject:
+          properties-file: systest_repos.jenkins-injectfile
diff --git a/maintenance-ci/mos/macroses/guess-mirror.yaml b/maintenance-ci/mos/macroses/guess-mirror.yaml
new file mode 100644 (file)
index 0000000..49bb73d
--- /dev/null
@@ -0,0 +1,6 @@
+- builder:
+    name: guess-mirror
+    builders:
+      - shell: !include-raw: ../scripts/guess-mirror.sh
+      - inject:
+          properties-file: mirror.jenkins-injectfile
\ No newline at end of file
diff --git a/maintenance-ci/mos/macroses/inject-properties-file.yaml b/maintenance-ci/mos/macroses/inject-properties-file.yaml
new file mode 100644 (file)
index 0000000..c22a0d6
--- /dev/null
@@ -0,0 +1,25 @@
+- builder:
+    name: inject-properties-file
+
+    builders:
+
+    - shell: |
+        #!/bin/bash
+        set -e
+        # Here we mimic EnvInject logger to have more natural output
+        # We add * inside [] to make mimic logs differ from natural ones
+        # We don't add "set -x" because this will break all the idea of natural output
+        # We don't check given parameters because JJB will fail on undefined
+
+        echo "[EnvInject*] - Going to inject variables from '{properties-file}'"
+        echo "[EnvInject*] - Going to inject as environment variables the content of '{properties-file}'"
+        cat {properties-file}
+
+        # it's common that file desn't have newline at the end, so echo w/ newline
+        echo
+
+        # EnvInject logs do have empty line at the very end, so we mimic this too
+        echo
+
+    - inject:
+        properties-file: '{properties-file}'
diff --git a/maintenance-ci/mos/macroses/make-snapshots.yaml b/maintenance-ci/mos/macroses/make-snapshots.yaml
new file mode 100644 (file)
index 0000000..5c14a4d
--- /dev/null
@@ -0,0 +1,17 @@
+- builder:
+    name: 9x-make-snapshots
+    builders:
+    # Calculate all snapshot data
+    # creates snapshots.params and snapshots.sh
+    - shell:
+        !include-raw:
+          '../scripts/freeze_deps_for_systest.sh'
+
+- builder:
+    name: 9x-make-plugin-snapshots
+    builders:
+    # Calculate all plugin snapshot data
+    # updates snapshots.params and snapshots.sh
+    - shell:
+        !include-raw:
+          '../scripts/freeze_deps_for_systest_plugin.sh'
diff --git a/maintenance-ci/mos/macroses/post-destroy-vm.yaml b/maintenance-ci/mos/macroses/post-destroy-vm.yaml
new file mode 100644 (file)
index 0000000..ca67919
--- /dev/null
@@ -0,0 +1,18 @@
+- publisher:
+    name: post-destroy-vms
+    publishers:
+    - post-tasks:
+        - matches:
+            - log-text: '.*'
+              operator: AND
+          script: |
+              #!/bin/bash
+
+              set -ex
+
+              dos_environment_file="${WORKSPACE}/${DOS_ENV_NAME_PROPS_FILE:=.dos_environment_name}"
+              if [ -f $dos_environment_file ] ;  then
+                source "${dos_environment_file}"
+              fi
+              source "${VENV_PATH}/bin/activate"
+              dos.py destroy "${ENV_NAME}"
diff --git a/maintenance-ci/mos/macroses/write-description.yaml b/maintenance-ci/mos/macroses/write-description.yaml
new file mode 100644 (file)
index 0000000..80360c7
--- /dev/null
@@ -0,0 +1,7 @@
+- builder:
+    name: write-description
+    builders:
+    - shell: |
+        #!/bin/bash
+        set -ex
+        echo "Description string: {description-string}"
\ No newline at end of file
diff --git a/maintenance-ci/mos/scripts/freeze_deps_for_systest.sh b/maintenance-ci/mos/scripts/freeze_deps_for_systest.sh
new file mode 100644 (file)
index 0000000..661aea7
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+set -ex
+
+# we just search for snapshots, no need to guess nearest
+# MIRROR_HOST="mirror.fuel-infra.org"
+
+# fixme: mirror.fuel-infra.org could point to brokem mirror
+MIRROR_HOST="mirror.seed-cz1.fuel-infra.org"
+
+rm -rvf snapshots.params snapshots.sh
+
+function to_uppercase() {
+    echo "$1" | awk '{print toupper($0)}'
+}
+
+function store() {
+    echo "$1=$2" >> snapshots.params
+    echo "$1=\"$2\"" >> snapshots.sh
+}
+
+
+
+# Create and store ID of this snapshot file, which will be used as PK for snapshot set
+
+# id for testrail to report test results
+__snapshot_id_default="snapshot #${BUILD_NUMBER?}"
+__snapshot_id="${CUSTOM_VERSION:-$__snapshot_id_default}"
+store "CUSTOM_VERSION" "${__snapshot_id}"
+# unix timestamp of snapshot
+__snapshot_timestamp="$(date +%s)"
+store "SNAPSHOT_TIMESTAMP" "${__snapshot_timestamp}"
+
+
+# Create and store MAGNET_LINK
+
+store "MAGNET_LINK" "${MAGNET_LINK?}"
+
+
+
+# Store FUEL_QA_COMMIT
+
+store "FUEL_QA_COMMIT" "$(git -C . rev-parse HEAD)"
+
+
+# Store snapshot for copy of Ubuntu deb repo
+
+# http://mirror.seed-cz1.fuel-infra.org/pkgs/snapshots/ubuntu-2016-07-13-172538
+#                                                      ^^^^^^^^^^^^^^^^^^^^^^^^
+__ubuntu_latest_repo_snaphot_id=$(curl -sSf "${MIRROR_HOST}/pkgs/snapshots/ubuntu-latest.target.txt" | sed '1p;d')
+store "UBUNTU_MIRROR_ID" "${__ubuntu_latest_repo_snaphot_id}"
+
+
+
+# Store snapshot for copy of Centos rpm repo
+
+# http://mirror.fuel-infra.org/pkgs/snapshots/centos-7.2.1511-2016-05-31-083834/
+#                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+__centos_latest_repo_snaphot_id=$(curl -sSf "${MIRROR_HOST}/pkgs/snapshots/centos-7.3.1611-latest.target.txt" | sed '1p;d')
+store "CENTOS_MIRROR_ID" "${__centos_latest_repo_snaphot_id}"
+
+
+
+# Store snapshot for MOS deb repo
+
+# 9.0-2016-06-23-164100
+# ^^^^^^^^^^^^^^^^^^^^^
+__mos_latest_deb_mirror_id="$(\
+    curl "http://${MIRROR_HOST}/mos-repos/ubuntu/snapshots/9.0-latest.target.txt" \
+    | head -1)"
+store "MOS_UBUNTU_MIRROR_ID" "${__mos_latest_deb_mirror_id}"
+
+
+
+# Store snapshots for full set of MOS rpm repos
+
+# <distribution_name>-2016-07-14-082020
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+for _dn in  "os"        \
+            "proposed"  \
+            "updates"   \
+            "holdback"  \
+            "hotfix"    \
+            "security"  ; do
+    __dt_snapshot="$(\
+        curl "http://${MIRROR_HOST}/mos-repos/centos/mos9.0-centos7/snapshots/${_dn}-latest.target.txt" \
+        | head -1)"
+    store "MOS_CENTOS_$(to_uppercase "${_dn}")_MIRROR_ID" "${__dt_snapshot}"
+done
+
diff --git a/maintenance-ci/mos/scripts/freeze_deps_for_systest_plugin.sh b/maintenance-ci/mos/scripts/freeze_deps_for_systest_plugin.sh
new file mode 100644 (file)
index 0000000..5217807
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+set -ex
+# TBD: This script will be extended with plugin-related data
+
+# Variables:
+# whole os plugin url example:
+# PLUGIN_REPO_SUB_URL="extras/murano-plugin-repos/"
+# PLUGIN_VERSION="release/1.0.0" or ""
+# PLUGIN_MOS_VERSION="mos9.0"
+# PLUGIN_PKG_DIST="centos7"
+# http://mirror.fuel-infra.org/extras/murano-plugin-repos/centos/mos9.0-centos7/os
+#
+# For guess rpm filename
+# PLUGIN_RPM_MASK="detach-murano"
+
+# fixme: mirror.fuel-infra.org could point to brokem mirror
+MIRROR_HOST="${MIRROR_HOST:-mirror.seed-cz1.fuel-infra.org}"
+
+function to_uppercase() {
+    echo "$1" | awk '{print toupper($0)}'
+}
+
+function store() {
+    echo "$1=$2" >> snapshots.params
+    echo "$1=\"$2\"" >> snapshots.sh
+}
+
+
+function guess_rpm_filename(){
+
+   # Dirty hack, for determine rpm filename from repo, by mask
+   # Should be rewrited to yumdownloared based soluthion
+   local t_file;t_file=$(mktemp)
+   local file_mask;file_mask=$1
+   local snapshot_id;snapshot_id=$2
+
+   wget  "${plugin_repo_long_url}/snapshots/${snapshot_id}/x86_64/Packages/" -O "${t_file}"
+   store "PLUGIN_RPM_FILENAME_FROM_REPO" "$(grep "${file_mask}" "${t_file}" | sed -n 's/.*href="\([^"]*\).*/\1/p'  | sort -ru | head -n 1)"
+   rm -vf "${t_file}"
+}
+
+store PLUGIN_REPO_SUB_URL   "${PLUGIN_REPO_SUB_URL?}"
+store PLUGIN_VERSION        "${PLUGIN_VERSION?}"
+store PLUGIN_MOS_VERSION    "${PLUGIN_MOS_VERSION?}"
+store PLUGIN_PKG_DIST       "${PLUGIN_PKG_DIST?}"
+store PLUGIN_RPM_MASK       "${PLUGIN_RPM_MASK?}"
+
+# todo: cd into project and get sha of commit
+store PLUGIN_TEST_REPO      "${PLUGIN_TEST_REPO?}"
+store PLUGIN_TEST_COMMIT    "${PLUGIN_TEST_COMMIT?}" # not frozen.
+
+# Store snapshot for copy of rpm repo
+# http://mirror.fuel-infra.org/extras/murano-plugin-repos/centos/mos9.0-centos7/os.target.txt >>
+# http://mirror.fuel-infra.org/extras/murano-plugin-repos/centos/mos9.0-centos7/snapshots/os-2016-09-21-210927/
+#                                                                                         ^^^^^^^^^^^^^^^^^^^^
+plugin_repo_long_url="http://${MIRROR_HOST}/${PLUGIN_REPO_SUB_URL}/${PLUGIN_VERSION}/centos/${PLUGIN_MOS_VERSION}-${PLUGIN_PKG_DIST}/"
+
+__plugin_latest_repo_snaphot_url="$(\
+    curl "${plugin_repo_long_url}/os.target.txt" \
+    | head -1)"
+plugin_latest_repo_snaphot_id="${__plugin_latest_repo_snaphot_url##*/}"
+store "PLUGIN_OS_REPO_ID" "${plugin_latest_repo_snaphot_id}"
+
+guess_rpm_filename "${PLUGIN_RPM_MASK}" "${plugin_latest_repo_snaphot_id}"
diff --git a/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh b/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh
new file mode 100644 (file)
index 0000000..9935926
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -ex
+
+mkdir -p logs
+rm -rf logs/*
+
+# for cloud-based testing we will use "one OS instance - one devops lab"
+# in this case we want to use the same ENV_NAME without additions like BUILD_ID
+export ENV_NAME="9.x_virtual_lab"
+echo "ENV_NAME=${ENV_NAME}" > ${WORKSPACE}/${DOS_ENV_NAME_PROPS_FILE:=.dos_environment_name}
+export ISO_PATH=$(seedclient-wrapper -d -m "${MAGNET_LINK?}" -v --force-set-symlink -o "${WORKSPACE?}")
+export MAKE_SNAPSHOT=${MAKE_SNAPSHOT:-false}
+
+echo "Description string: ${TEST_GROUP?} on ${CUSTOM_VERSION?}"
+
+set +x
+echo "======================================================"
+echo "=====================ENV VARS========================="
+env
+echo "======================================================"
+echo "======================================================"
+set -x
+set +x
+echo "======================================================"
+echo "=====================MOS VARS========================="
+echo "UPDATE_FUEL_MIRROR: ${UPDATE_FUEL_MIRROR}"
+echo "EXTRA_DEB_REPOS: ${EXTRA_DEB_REPOS}"
+echo "======================================================"
+echo "======================================================"
+set -x
+
+source "${VENV_PATH}/bin/activate"
+  pip install -U -r fuelweb_test/requirements.txt > logs/pip_install_output.log
+  export PYTHONPATH="${WORKSPACE}"
+  if [[ $DELETE_ENV_BEFORE_RUN = true ]] ; then dos.py erase $ENV_NAME || true; fi
+  python run_system_test.py run -q --nologcapture --with-xunit "${TEST_GROUP}"
+deactivate
+
+# VMs will be shut down by post-build step
diff --git a/maintenance-ci/mos/scripts/guess-mirror.sh b/maintenance-ci/mos/scripts/guess-mirror.sh
new file mode 100644 (file)
index 0000000..00b31f1
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+set -o xtrace
+
+# fixme: this section is for disabling our mirror snapshots for xenial builds, need rework
+if [ "${GUESS_MIRROR:-true}" == false ] ; then
+
+    echo > mirror.setenvfile
+    echo > mirror.jenkins-injectfile
+    exit 0
+fi
+
+###################### Guess mirror host ###############
+
+# Top guess ever
+MIRROR_HOST="mirror.seed-us1.fuel-infra.org"
+
+###################### Get MIRROR_UBUNTU ###############
+
+# If UBUNTU_MIRROR_ARTIFACT is set get UBUNTU_MIRROR_ID from artifact
+if [[ -n "${UBUNTU_MIRROR_ARTIFACT}" ]]; then
+    export $(curl -sSf "${UBUNTU_MIRROR_ARTIFACT}")
+fi
+
+UBUNTU_MIRROR_ID=${UBUNTU_MIRROR_ID:-latest}
+UBUNTU_DIST=${UBUNTU_DIST:-trusty}
+
+# By default disable Ubuntu proposed repository
+ENABLE_UBUNTU_PROPOSED=${ENABLE_UBUNTU_PROPOSED:-false}
+
+if [ -z "${MIRROR_UBUNTU}" ]; then
+    if [ "${UBUNTU_MIRROR_ID}" = "latest" ]; then
+        UBUNTU_MIRROR_ID=$(curl -sSf "http://${MIRROR_HOST}/pkgs/snapshots/ubuntu-${UBUNTU_MIRROR_ID}.target.txt" | sed '1p;d')
+    fi
+    UBUNTU_MIRROR_URL="http://${MIRROR_HOST}/pkgs/snapshots/${UBUNTU_MIRROR_ID}/"
+
+    MIRROR_UBUNTU="deb ${UBUNTU_MIRROR_URL} ${UBUNTU_DIST} main universe multiverse|deb ${UBUNTU_MIRROR_URL} ${UBUNTU_DIST}-updates main universe multiverse|deb ${UBUNTU_MIRROR_URL} ${UBUNTU_DIST}-security main universe multiverse"
+
+    # Add proposed repository only when required
+    if [[ "${ENABLE_UBUNTU_PROPOSED}" = true ]]; then
+        MIRROR_UBUNTU="${MIRROR_UBUNTU}|deb ${UBUNTU_MIRROR_URL} ${UBUNTU_DIST}-proposed main universe multiverse"
+    fi
+fi
+
+# Save parameters to file in format required by source in bash
+cat > mirror.setenvfile <<EOF
+MIRROR_HOST="${MIRROR_HOST}"
+UBUNTU_MIRROR_URL="${UBUNTU_MIRROR_URL}"
+MIRROR_UBUNTU="${MIRROR_UBUNTU}"
+EOF
+# Save parameters to file in format required by jenkins inject
+cat > mirror.jenkins-injectfile <<EOF
+MIRROR_HOST=${MIRROR_HOST}
+UBUNTU_MIRROR_URL=${UBUNTU_MIRROR_URL}
+MIRROR_UBUNTU=${MIRROR_UBUNTU}
+EOF
diff --git a/maintenance-ci/mos/scripts/snapshot.params.sh b/maintenance-ci/mos/scripts/snapshot.params.sh
new file mode 100644 (file)
index 0000000..24b6b87
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+set -ex
+
+rm -rvf snapshots.params snapshots.sh snapshots.export.sh
+
+function to_uppercase() {
+    echo "$1" | awk '{print toupper($0)}'
+}
+
+function store() {
+    echo "$1=$2" >> snapshots.params
+    echo "$1=\"$2\"" >> snapshots.sh
+    echo "export $1=\"$2\"" >> snapshots.export.sh
+}
+
+
+store "CUSTOM_VERSION" "snapshot #${BUILD_NUMBER?}"
+store "MIRROR_HOST" "${MIRROR_HOST?}"
+store "SNAPSHOT_TIMESTAMP" "$(date +%s)"
+store "MAGNET_LINK" "${MAGNET_LINK?}"
+
+# snapshot for copy of ubuntu deb repo
+if [[ -n "${SRC_UBUNTU_MIRROR}" ]]; then
+    __ubuntu_latest_repo_snaphot_id=$(curl -sSf "${MIRROR_HOST}/${SRC_UBUNTU_MIRROR}" | sed '1p;d')
+    store "UBUNTU_MIRROR_ID" "${__ubuntu_latest_repo_snaphot_id}"
+fi
+
+# snapshot for copy of centos rpm repo
+if [[ -n "${SRC_CENTOS_MIRROR}" ]]; then
+    __centos_latest_repo_snaphot_id=$(curl -sSf "${MIRROR_HOST}/${SRC_CENTOS_MIRROR}" | sed '1p;d')
+    store "CENTOS_MIRROR_ID" "${__centos_latest_repo_snaphot_id}"
+fi
+
+# snapshot for mos ubuntu deb repo
+__mos_latest_deb_mirror_id="$(curl "${MIRROR_HOST}/${SRC_MOS_UBUNTU_MIRROR}" | head -1)"
+store "MOS_UBUNTU_MIRROR_ID" "${__mos_latest_deb_mirror_id}"
+
+# snapshots for all mos centos rpm repos
+for _dn in  "os" "proposed" "updates" "holdback" "hotfix" "security"; do
+    echo "Using auto-generated ${_dn} repo"
+    __dt_snapshot="$(curl "${MIRROR_HOST}/${SRC_MOS_CENTOS_REPOS_PREFIX}/${_dn}-latest.target.txt" | head -1)"
+    store "MOS_CENTOS_$(to_uppercase "${_dn}")_MIRROR_ID" "${__dt_snapshot}"
+done
+
+if [[ -n "${SRC_CENTOS_SECURITY_PROPOSED}" ]]; then
+    store "CENTOS_SECURITY_PROPOSED" "${SRC_CENTOS_SECURITY_PROPOSED}"
+fi
+
diff --git a/maintenance-ci/mos/scripts/systest_repos_parsing.sh b/maintenance-ci/mos/scripts/systest_repos_parsing.sh
new file mode 100644 (file)
index 0000000..e953299
--- /dev/null
@@ -0,0 +1,138 @@
+#!/bin/bash
+
+set -ex
+
+function join() {
+    local __sep="${1}"
+    local __head="${2}"
+    local __tail="${3}"
+
+    if [[ -n "${__head}" ]]; then
+        echo "${__head}${__sep}${__tail}"
+    else
+        echo "${__tail}"
+    fi
+}
+
+function to_uppercase() {
+    echo "$1" | awk '{print toupper($0)}'
+}
+
+__space=' '
+__pipe='|'
+
+# Fetch params from snapshot job
+if [[ ! "${SNAPSHOT_PARAMS_ID}" ]]; then
+    SNAPSHOT_PARAMS_ID="lastSuccessfulBuild"
+fi
+
+curl -s "http://maintenance-ci.scc.mirantis.net/job/9.x.snapshot.params/${SNAPSHOT_PARAMS_ID}/artifact/snapshots.sh" > snapshots.sh
+
+while read line ; do
+ var_name=$(echo "${line}" | awk -F '=' '{print $1}')
+ var_overwrite="$(join "_" "${var_name}" "$(to_uppercase "overwrite")")"
+ if [[ ! -z ${!var_overwrite} ]]
+ then
+  declare ${var_name}="${!var_overwrite}"
+ else
+  eval "${line}"
+ fi
+done <snapshots.sh
+
+### LOCATION CODE - use "guess-mirror builder"
+
+# Adding Ubuntu deb repos to
+# - MIRROR_UBUNTU - will be used for nodes in cluster
+# UBUNTU_MIRROR_ID comes from snapshot.sh file
+UBUNTU_MIRROR_URL="http://${MIRROR_HOST}/pkgs/snapshots/${UBUNTU_MIRROR_ID}/"
+for __dn in "trusty"         \
+            "trusty-updates" \
+            "trusty-security"; do
+    __repo="deb ${UBUNTU_MIRROR_URL} ${__dn} main universe multiverse"
+    MIRROR_UBUNTU="$(join "${__pipe}" "${MIRROR_UBUNTU}" "${__repo}")"
+done
+
+if [ "${ENABLE_UBUNTU_MIRROR_PROPOSED}" = true ]; then
+    __repo="deb ${UBUNTU_MIRROR_URL} trusty-proposed main universe multiverse"
+    MIRROR_UBUNTU="$(join "${__pipe}" "${MIRROR_UBUNTU}" "${__repo}")"
+fi
+
+
+# Adding snapshots of upstream CentOS repositories os, updates and extras
+# using snapshot ID to the UPDATE_FUEL_MIRROR variable
+
+if [[ ! -z ${CENTOS_MIRROR_ID} ]]; then
+    for __repo in "os"      \
+                  "extras"  \
+                  "updates" ; do
+        __url="http://${MIRROR_HOST}/pkgs/snapshots/${CENTOS_MIRROR_ID}/${__repo}/x86_64"
+        UPDATE_FUEL_MIRROR="$(join "${__space}" "${UPDATE_FUEL_MIRROR}" "${__url}" )"
+    done
+fi
+
+
+# Adding MOS rpm repos to
+# - UPDATE_FUEL_MIRROR - will be used for master node
+# - EXTRA_RPM_REPOS - will be used for nodes in cluster
+
+for _dn in  "os"        \
+            "proposed"  \
+            "updates"   \
+            "holdback"  \
+            "hotfix"    \
+            "security"  ; do
+    # a pointer to variable name which holds value of enable flag for this dist name
+    __enable_ptr="ENABLE_MOS_CENTOS_$(to_uppercase "${_dn}")"
+    if [[ "${!__enable_ptr}" = true ]] ; then
+        # a pointer to variable name which holds repo id
+        __repo_id_ptr="MOS_CENTOS_$(to_uppercase "${_dn}")_MIRROR_ID"
+        __repo_url="http://${MIRROR_HOST}/mos-repos/centos/mos9.0-centos7/snapshots/${!__repo_id_ptr}/x86_64"
+        UPDATE_FUEL_MIRROR="$(join "${__space}" "${UPDATE_FUEL_MIRROR}" "${__repo_url}" )"
+    fi
+done
+
+# UPDATE_MASTER=true in case when we have set some repos
+# otherwise there will be no reason to start updating without any repos to update from
+
+if [[ -n "${UPDATE_FUEL_MIRROR}" ]] ; then
+    UPDATE_MASTER=${UPDATE_MASTER:-true}
+fi
+
+# Adding MOS deb repos to
+# - EXTRA_DEB_REPOS - will be used for nodes in cluster
+
+for _dn in  "proposed"  \
+            "updates"   \
+            "holdback"  \
+            "hotfix"    \
+            "security"  ; do
+    # a pointer to variable name which holds value of enable flag for this dist name
+    __enable_ptr="ENABLE_MOS_UBUNTU_$(to_uppercase "${_dn}")"
+    # a pointer to variable name which holds repo id
+    __repo_id_ptr="MOS_UBUNTU_MIRROR_ID"
+    __repo_url="http://${MIRROR_HOST}/mos-repos/ubuntu/snapshots/${!__repo_id_ptr}"
+    if [[ "${!__enable_ptr}" = true ]] ; then
+        __repo_name="mos-${_dn},deb ${__repo_url} mos9.0-${_dn} main restricted"
+        EXTRA_DEB_REPOS="$(join "${__pipe}" "${EXTRA_DEB_REPOS}" "${__repo_name}")"
+    fi
+done
+
+echo "<============> REPOS PARSING RESULTS <============>"
+echo "MAGNET_LINK: ${MAGNET_LINK}"
+echo "UPDATE_MASTER: ${UPDATE_MASTER}"
+echo "UPDATE_FUEL_MIRROR: ${UPDATE_FUEL_MIRROR}"
+echo "MIRROR_UBUNTU: ${MIRROR_UBUNTU}"
+echo "EXTRA_RPM_REPOS: ${EXTRA_RPM_REPOS}"
+echo "EXTRA_DEB_REPOS: ${EXTRA_DEB_REPOS}"
+echo "MIRROR_HOST: ${MIRROR_HOST}"
+echo "<=================================================>"
+
+cat > systest_repos.jenkins-injectfile <<EOF
+MAGNET_LINK=${MAGNET_LINK}
+UPDATE_MASTER=${UPDATE_MASTER}
+UPDATE_FUEL_MIRROR=${UPDATE_FUEL_MIRROR}
+MIRROR_UBUNTU=${MIRROR_UBUNTU}
+EXTRA_RPM_REPOS=${EXTRA_RPM_REPOS}
+EXTRA_DEB_REPOS=${EXTRA_DEB_REPOS}
+MIRROR_HOST=${MIRROR_HOST}
+EOF
diff --git a/maintenance-ci/mos/scripts/testrail-report-9.x.sh b/maintenance-ci/mos/scripts/testrail-report-9.x.sh
new file mode 100644 (file)
index 0000000..8715fb2
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# TestRail
+
+set -ex
+mkdir -p logs
+
+export TESTRAIL_REPORTER_PATH="${TESTRAIL_REPORTER_PATH:-"fuelweb_test/testrail/report.py"}"
+export TESTRAIL_PROJECT="${TESTRAIL_PROJECT:-"Mirantis OpenStack"}"
+export TESTRAIL_URL="https://mirantis.testrail.com"
+
+# Prepare venv
+source "${VENV_PATH}/bin/activate"
+ pip install -U -r fuelweb_test/requirements.txt > logs/pip_install_output.log
+ export PYTHONPATH="$(pwd):$PYTHONPATH"
+
+# Report tests results from swarm (Ubuntu)
+ export USE_UBUNTU=true
+ export USE_CENTOS=false
+# shellcheck disable=SC2086
+ python ${TESTRAIL_REPORTER_PATH} -v -s
+deactivate
\ No newline at end of file
diff --git a/maintenance-ci/mos/scripts/testrail-upload-cases-9.x.sh b/maintenance-ci/mos/scripts/testrail-upload-cases-9.x.sh
new file mode 100644 (file)
index 0000000..d5a2577
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# TestRail
+
+set -ex
+mkdir -p logs
+
+export TESTRAIL_PROJECT="${TESTRAIL_PROJECT:-"Mirantis OpenStack"}"
+export TESTRAIL_URL="https://mirantis.testrail.com"
+
+# Prepare venv
+source "${VENV_PATH}/bin/activate"
+ pip install -U -r fuelweb_test/requirements.txt > logs/pip_install_output.log
+ export PYTHONPATH="$(pwd):$PYTHONPATH"
+ python fuelweb_test/testrail/upload_cases_description.py -v -j "${TESTS_RUNNER}"
+ # stub for debugging part of migration
+ python fuelweb_test/testrail/upload_cases_description.py -v -j "9.x.swarm.micro.runner"
+deactivate
\ No newline at end of file
diff --git a/maintenance-ci/mos/templates/snapshot.yaml b/maintenance-ci/mos/templates/snapshot.yaml
new file mode 100644 (file)
index 0000000..be90593
--- /dev/null
@@ -0,0 +1,47 @@
+- job-template:
+    name: '{version}.snapshot.params'
+
+    timer: ''
+    magnet-link: ''
+    mirror-host: 'mirror.seed-us1.fuel-infra.org'
+    src-ubuntu-mirror: 'pkgs/snapshots/ubuntu-latest.target.txt'
+    src-centos-mirror: ''
+    src-mos-ubuntu-mirror: ''
+    src-mos-centos-repos-prefix: ''
+    src-centos-security-proposed: ''
+
+    node: 'jenkins-master'
+
+    triggers:
+      - timed: '{timer}'
+
+    builders:
+      - inject:
+          properties-content: |
+            MAGNET_LINK={magnet-link}
+            MIRROR_HOST={mirror-host}
+            SRC_UBUNTU_MIRROR={src-ubuntu-mirror}
+            SRC_CENTOS_MIRROR={src-centos-mirror}
+            SRC_MOS_UBUNTU_MIRROR={src-mos-ubuntu-mirror}
+            SRC_MOS_CENTOS_REPOS_PREFIX={src-mos-centos-repos-prefix}
+            SRC_CENTOS_SECURITY_PROPOSED={src-centos-security-proposed}
+      - shell:
+          !include-raw-escape:
+            '../scripts/snapshot.params.sh'
+      - inject-properties-file:
+          properties-file: 'snapshots.params'
+      - write-description:
+          description-string: $CUSTOM_VERSION
+
+    publishers:
+      - description-setter:
+          regexp: "'Description string: (.*)'"
+      - archive:
+          artifacts: 'snapshots.params'
+          allow-empty: false
+      - archive:
+          artifacts: 'snapshots.sh'
+          allow-empty: false
+      - archive:
+          artifacts: 'snapshots.export.sh'
+          allow-empty: false
diff --git a/maintenance-ci/mos/templates/swarm-test.yaml b/maintenance-ci/mos/templates/swarm-test.yaml
new file mode 100644 (file)
index 0000000..e277971
--- /dev/null
@@ -0,0 +1,92 @@
+- job-template:
+    name: '9.x.{testgroup}'
+    id: mos/templates/swarm-test
+
+    swarm-test/node: 'mos.fuel.base'
+    swarm-test/weight: '7'
+
+    swarm-test/venvpath: '/home/jenkins/qa-venv-9.x'
+
+    swarm-test/custom-overrides-plain-properties: ''
+    swarm-test/custom-overrides-properties-file: ''
+    swarm-test/timeout: '180'
+    swarm-test/make-snapshot: 'false'
+
+    swarm-test/build-discarder/artifactDaysToKeep: -1
+    swarm-test/build-discarder/artifactNumToKeep: -1
+    swarm-test/build-discarder/daysToKeep: 60
+    swarm-test/build-discarder/numToKeep: 20
+
+    description: 'Run Swarm Test {testgroup}'
+    node: '{swarm-test/node}'
+    concurrent: true
+
+    build-discarder:
+        artifactDaysToKeep: '{swarm-test/build-discarder/artifactDaysToKeep}'
+        artifactNumToKeep: '{swarm-test/build-discarder/artifactNumToKeep}'
+        daysToKeep: '{swarm-test/build-discarder/daysToKeep}'
+        numToKeep: '{swarm-test/build-discarder/numToKeep}'
+
+    parameters:
+    - 9x-systest-params
+    - text:
+        name: EXTRA_OPTS
+        default: ""
+
+    properties:
+    - heavy-job:
+        weight: '{swarm-test/job-weight}'
+
+    scm:
+    - git:
+        url: 'https://review.fuel-infra.org/openstack/{swarm-test/reponame}.git'
+        branches:
+          - '{swarm-test/repobranch}'
+        basedir: ''
+
+    wrappers:
+    - timeout:
+        fail: false
+        timeout: '{swarm-test/timeout}'
+        write-description: false
+    - ansicolor:
+        colormap: xterm
+
+    builders:
+    - inject: # Defaults
+        properties-content: |
+          OPENSTACK_RELEASE=ubuntu
+          TEST_GROUP={testgroup}
+          VENV_PATH={swarm-test/venvpath}
+          MAKE_SNAPSHOT={swarm-test/make-snapshot}
+          SLAVE_NODE_MEMORY=4096
+          SLAVE_NODE_CPU=2
+          ADMIN_NODE_MEMORY=4096
+          ADMIN_NODE_CPU=2
+
+    - inject: # Overrides
+        properties-content: '{swarm-test/custom-overrides-plain-properties}'
+    - inject-text-parameter:
+        properties-content: $MOS_MIRROR_OVERWRITES
+    - 9x-run-sys-test
+
+    publishers:
+
+    - archive:
+        allow-empty: true
+        artifacts: '**/nosetests.xml,logs/*,*.txt'
+        latest-only: false
+    - junit:
+        keep-long-stdio: false
+        results: '**/nosetests.xml'
+
+    - post-destroy-vms
+
+    - description-setter:
+        regexp: "'Description string: (.*)'"
+        regexp-for-failed: "'Description string: (.*)'"
+
+    - trigger-parameterized-builds:
+        - project: '9.x.swarm.test-reports'
+          condition: ALWAYS
+          trigger-with-no-params: true
diff --git a/maintenance-ci/mos/templates/testrail-report-9.x.yaml b/maintenance-ci/mos/templates/testrail-report-9.x.yaml
new file mode 100644 (file)
index 0000000..1e5845e
--- /dev/null
@@ -0,0 +1,48 @@
+- job-template:
+    id: mos/templates/test-report-9.x
+    name: '{version}.swarm.test-reports'
+
+    build-discarder:
+      daysToKeep: '{testrail_reporter/logrotate/daysToKeep}'
+      numToKeep: '{testrail_reporter/logrotate/numToKeep}'
+
+
+    node: '{testrail_reporter/node}'
+
+    triggers:
+      - timed: ''
+
+    scm:
+    - git:
+        url: 'https://review.fuel-infra.org/openstack/fuel-qa.git'
+        branches:
+            - '{testrail_reporter/fuel-qa-branch}'
+        basedir: ''
+
+    wrappers:
+    - credentials-binding:
+        - username-password-separated:
+            credential-id: testrail_credentials
+            username: TESTRAIL_USER
+            password: TESTRAIL_PASSWORD
+
+    builders:
+    - inject:
+        properties-content: |
+            VENV_PATH={testrail_reporter/venv_path}
+            TESTS_RUNNER={testrail_reporter/test_runner_job}
+    - inject:
+        properties-content: |
+            TESTRAIL_TEST_SUITE={testrail_reporter/testrail_suite}
+            TESTRAIL_MILESTONE={testrail_reporter/testrail_milestone}
+            LAUNCHPAD_MILESTONE={testrail_reporter/launchpad_milestone}
+    - shell:
+        !include-raw-escape: ../scripts/testrail-upload-cases-9.x.sh
+    - shell:
+        !include-raw-escape: ../scripts/testrail-report-9.x.sh
+
+
+    publishers:
+    - description-setter:
+        regexp: '^.*Report URL:\s*(.*)'
+        description: '<a href="\1">TestRail Report URL</a>'
diff --git a/maintenance-ci/views/.keep b/maintenance-ci/views/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/maintenance-ci/views/9.x.tempest.yaml b/maintenance-ci/views/9.x.tempest.yaml
new file mode 100644 (file)
index 0000000..7112fdd
--- /dev/null
@@ -0,0 +1,18 @@
+- view:
+    type: list
+    name: '9.x.tempest'
+    regex: '9.x.tempest.*'
+#    jobs:
+#      - 9.x.tempest
+#      - maintenance-tempest-reports-Testrail
+#      - maintenance-tempest-runner
+    columns:
+      - status
+      - weather
+      - job
+      - last_success
+      - last_failure
+      - last_duration
+      - build_button
+    recurse: False
+
diff --git a/maintenance-ci/views/9.x.yaml b/maintenance-ci/views/9.x.yaml
new file mode 100644 (file)
index 0000000..3e42384
--- /dev/null
@@ -0,0 +1,23 @@
+- view:
+  type: list
+  name: '9.x'
+  regex: '9.x.*'
+#  jobs:
+#  - 9.x.snapshot.params
+#  - 9.x.swarm.runner
+#  - 9.x.swarm.micro.runner
+#  - 9.x.acceptance.runner
+#  - 9.x.acceptance.test-reports
+#  - 9.x.backup-restore.test-reports
+#  - 9.x.baremetal.test-reports
+#  - 9.0.proposed-to-updates
+  columns:
+  - status
+  - weather
+  - job
+  - last_success
+  - last_failure
+  - last_duration
+  - build_button
+  recurse: False
+