Merge "Add Zuulv3 native jobs for the dummy driver"
diff --git a/playbooks/manila-tempest-plugin-standalone/post.yaml b/playbooks/manila-tempest-plugin-standalone/post.yaml
new file mode 100644
index 0000000..6e0bcad
--- /dev/null
+++ b/playbooks/manila-tempest-plugin-standalone/post.yaml
@@ -0,0 +1,6 @@
+- hosts: tempest
+  become: true
+  roles:
+    - role: fetch-subunit-output
+      zuul_work_dir: '{{ devstack_base_dir }}/tempest'
+    - role: process-stackviz
diff --git a/playbooks/manila-tempest-plugin-standalone/run.yaml b/playbooks/manila-tempest-plugin-standalone/run.yaml
new file mode 100644
index 0000000..8df9205
--- /dev/null
+++ b/playbooks/manila-tempest-plugin-standalone/run.yaml
@@ -0,0 +1,11 @@
+- hosts: all
+  roles:
+    - orchestrate-devstack
+
+- hosts: tempest
+  roles:
+    - setup-tempest-run-dir
+    - set-tempest-config
+    - setup-tempest-data-dir
+    - acl-devstack-files
+    - run-tempest
diff --git a/roles/set-tempest-config/README.rst b/roles/set-tempest-config/README.rst
new file mode 100644
index 0000000..9402d3c
--- /dev/null
+++ b/roles/set-tempest-config/README.rst
@@ -0,0 +1,19 @@
+set-tempest-config
+==================
+
+This is a workaround for the `merge_config_file <https://opendev
+.org/openstack/devstack/src/commit/76d7d7c90c3979c72404fddd31ee884c8bfdb1ec
+/inc/meta-config#L82>`_ routine that doesn't working correctly on jobs based on
+the "devstack-minimal" profile.
+
+**Role Variables**
+
+.. zuul:rolevar:: devstack_base_dir
+   :default: /opt/stack
+
+   The devstack base directory.
+
+.. zuul:rolevar:: devstack_local_conf_path
+   :default: "{{ devstack_base_dir }}/devstack/local.conf"
+
+   Where to find the local.conf file
diff --git a/roles/set-tempest-config/defaults/main.yml b/roles/set-tempest-config/defaults/main.yml
new file mode 100644
index 0000000..5cc7ca6
--- /dev/null
+++ b/roles/set-tempest-config/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+devstack_base_dir: /opt/stack
+devstack_local_conf_path: "{{ devstack_base_dir }}/devstack/local.conf"
diff --git a/roles/set-tempest-config/tasks/main.yml b/roles/set-tempest-config/tasks/main.yml
new file mode 100644
index 0000000..3572ff5
--- /dev/null
+++ b/roles/set-tempest-config/tasks/main.yml
@@ -0,0 +1,14 @@
+- name: Install required pip packages
+  pip:
+    name: devstack-tools
+    state: "latest"
+    virtualenv: /var/tmp/venv
+
+- name: Copy tempest config
+  shell: >-
+    . /var/tmp/venv/bin/activate && \
+    dsconf extract {{ devstack_local_conf_path }} \
+      test-config \
+      '$TEMPEST_CONFIG' \
+      {{ devstack_base_dir }}/tempest/etc/tempest.conf
+  become: yes
diff --git a/zuul.d/manila-tempest-jobs.yaml b/zuul.d/manila-tempest-jobs.yaml
index fee206a..c76346f 100644
--- a/zuul.d/manila-tempest-jobs.yaml
+++ b/zuul.d/manila-tempest-jobs.yaml
@@ -44,6 +44,8 @@
         MANILA_ALLOW_NAS_SERVER_PORTS_ON_HOST: true
         MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS: 'snapshot_support=True create_share_from_snapshot_support=True'
         MANILA_CONFIGURE_DEFAULT_TYPES: true
+        MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL: 1
+        MANILA_REPLICA_STATE_UPDATE_INTERVAL: 10
 
 
 - job:
@@ -59,6 +61,58 @@
     vars: *manila-tempest-base-vars
 
 - job:
+    name: manila-tempest-plugin-standalone-base
+    abstract: true
+    description: |
+      Base job for running a minimal devstack with tempest based manila jobs.
+    timeout: 3600
+    parent: devstack-minimal
+    irrelevant-files: *irrelevant-files
+    roles:
+      - zuul: opendev.org/openstack/devstack
+      - zuul: opendev.org/openstack/tempest
+    required-projects:
+      - openstack/keystone
+      - openstack/manila
+      - openstack/manila-tempest-plugin
+      - openstack/python-manilaclient
+      - openstack/tempest
+    run: playbooks/manila-tempest-plugin-standalone/run.yaml
+    post-run: playbooks/manila-tempest-plugin-standalone/post.yaml
+    vars:
+      tox_envlist: all
+      tempest_test_regex: manila_tempest_tests.tests.api
+      tempest_concurrency: 16
+      tempest_plugins:
+        - manila-tempest-plugin
+      devstack_plugins:
+        manila: https://opendev.org/openstack/manila
+        manila-tempest-plugin: https://opendev.org/openstack/manila-tempest-plugin
+      test_results_stage_name: test_results
+      zuul_copy_output:
+        '{{ devstack_base_dir }}/tempest/etc/tempest.conf': logs
+        '{{ devstack_base_dir }}/tempest/etc/accounts.yaml': logs
+        '{{ devstack_base_dir }}/tempest/tempest.log': logs
+        '{{ stage_dir }}/{{ test_results_stage_name }}.subunit': logs
+        '{{ stage_dir }}/{{ test_results_stage_name }}.html': logs
+        '{{ stage_dir }}/stackviz': logs
+      extensions_to_txt:
+        conf: true
+        log: true
+        yaml: true
+        yml: true
+      devstack_localrc:
+        USE_PYTHON3: true
+        MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE: false
+        MANILA_SERVICE_IMAGE_ENABLED: false
+        MANILA_SHARE_MIGRATION_PERIOD_TASK_INTERVAL: 1
+        MANILA_REPLICA_STATE_UPDATE_INTERVAL: 10
+      devstack_services:
+        tls-proxy: true
+        key: true
+        tempest: true
+
+- job:
     name: manila-tempest-plugin-zfsonlinux
     description: Test ZFSOnLinux multibackend (DHSS=False) with postgresql db
     parent: manila-tempest-plugin-base
@@ -309,4 +363,121 @@
               capability_create_share_from_snapshot_support: false
               image_password: manila
 
+- job:
+    name: manila-tempest-plugin-dummy-no-dhss
+    description: Test the Dummy driver with DHSS=False
+    parent: manila-tempest-plugin-standalone-base
+    vars:
+      devstack_localrc:
+        SHARE_DRIVER: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_CONFIGURE_GROUPS: alpha,beta,gamma,membernet
+        MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS: 'snapshot_support=True create_share_from_snapshot_support=True revert_to_snapshot_support=True mount_snapshot_support=True'
+        MANILA_ENABLED_BACKENDS: alpha,beta,gamma
+        MANILA_OPTGROUP_alpha_driver_handles_share_servers: false
+        MANILA_OPTGROUP_alpha_replication_domain: DUMMY_DOMAIN
+        MANILA_OPTGROUP_alpha_share_backend_name: ALPHA
+        MANILA_OPTGROUP_alpha_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_OPTGROUP_beta_driver_handles_share_servers: false
+        MANILA_OPTGROUP_beta_replication_domain: DUMMY_DOMAIN
+        MANILA_OPTGROUP_beta_share_backend_name: BETA
+        MANILA_OPTGROUP_beta_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+        # With below opts we'll enable a DHSS=True back-end solely for
+        # for the migration test case "test_migration_opposite_driver_modes"
+        MANILA_OPTGROUP_gamma_driver_handles_share_servers: true
+        MANILA_OPTGROUP_gamma_network_config_group: membernet
+        MANILA_OPTGROUP_gamma_share_backend_name: GAMMA
+        MANILA_OPTGROUP_gamma_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_OPTGROUP_gamma_admin_network_config_group: membernet
+        MANILA_OPTGROUP_membernet_network_api_class: manila.network.standalone_network_plugin.StandaloneNetworkPlugin
+        MANILA_OPTGROUP_membernet_network_plugin_ipv4_enabled: true
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_allowed_ip_ranges: 10.0.0.10-10.0.0.209
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_gateway: 10.0.0.1
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_mask: 24
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_network_type: vlan
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_segmentation_id: 1010
+      devstack_local_conf:
+        test-config:
+          "$TEMPEST_CONFIG":
+            share:
+              backend_names: ALPHA,BETA
+              backend_replication_type: readable
+              build_timeout: 180
+              capability_sg_consistent_snapshot_support: pool
+              enable_ip_rules_for_protocols: nfs
+              enable_ro_access_level_for_protocols: nfs,cifs
+              enable_user_rules_for_protocols: cifs
+              multi_backend: true
+              multitenancy_enabled: false
+              run_driver_assisted_migration_tests: true
+              run_manage_unmanage_snapshot_tests: true
+              run_manage_unmanage_tests: true
+              run_migration_with_preserve_snapshots_tests: true
+              run_mount_snapshot_tests: true
+              run_replication_tests: true
+              run_revert_to_snapshot_tests: true
+              # for migration test case "test_migration_opposite_driver_modes"
+              create_networks_when_multitenancy_enabled: false
 
+- job:
+    name: manila-tempest-plugin-dummy-dhss
+    description: Test the Dummy driver with DHSS=True
+    parent: manila-tempest-plugin-standalone-base
+    vars:
+      devstack_localrc:
+        SHARE_DRIVER: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_CONFIGURE_GROUPS: alpha,beta,gamma,membernet,adminnet
+        MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS: 'snapshot_support=True create_share_from_snapshot_support=True revert_to_snapshot_support=True mount_snapshot_support=True'
+        MANILA_ENABLED_BACKENDS: alpha,beta
+        MANILA_OPTGROUP_DEFAULT_quota_share_networks: 50
+        MANILA_OPTGROUP_adminnet_network_api_class: manila.network.standalone_network_plugin.StandaloneNetworkPlugin
+        MANILA_OPTGROUP_adminnet_network_plugin_ipv4_enabled: true
+        MANILA_OPTGROUP_adminnet_standalone_network_plugin_allowed_ip_ranges: 11.0.0.10-11.0.0.19,11.0.0.30-11.0.0.39,11.0.0.50-11.0.0.199
+        MANILA_OPTGROUP_adminnet_standalone_network_plugin_gateway: 11.0.0.1
+        MANILA_OPTGROUP_adminnet_standalone_network_plugin_mask: 24
+        MANILA_OPTGROUP_adminnet_standalone_network_plugin_network_type: vlan
+        MANILA_OPTGROUP_adminnet_standalone_network_plugin_segmentation_id: 1011
+        MANILA_OPTGROUP_alpha_admin_network_config_group: adminnet
+        MANILA_OPTGROUP_alpha_driver_handles_share_servers: true
+        MANILA_OPTGROUP_alpha_network_config_group: membernet
+        MANILA_OPTGROUP_alpha_replication_domain: DUMMY_DOMAIN
+        MANILA_OPTGROUP_alpha_share_backend_name: ALPHA
+        MANILA_OPTGROUP_alpha_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_OPTGROUP_beta_admin_network_config_group: adminnet
+        MANILA_OPTGROUP_beta_driver_handles_share_servers: true
+        MANILA_OPTGROUP_beta_network_config_group: membernet
+        MANILA_OPTGROUP_beta_replication_domain: DUMMY_DOMAIN
+        MANILA_OPTGROUP_beta_share_backend_name: BETA
+        MANILA_OPTGROUP_beta_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+        MANILA_OPTGROUP_membernet_network_api_class: manila.network.standalone_network_plugin.StandaloneNetworkPlugin
+        MANILA_OPTGROUP_membernet_network_plugin_ipv4_enabled: true
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_allowed_ip_ranges: 10.0.0.10-10.0.0.209
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_gateway: 10.0.0.1
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_mask: 24
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_network_type: vlan
+        MANILA_OPTGROUP_membernet_standalone_network_plugin_segmentation_id: 1010
+        # With below opts we'll enable a DHSS=False back-end solely for
+        # for the migration test case "test_migration_opposite_driver_modes"
+        MANILA_OPTGROUP_gamma_driver_handles_share_servers: false
+        MANILA_OPTGROUP_gamma_share_backend_name: GAMMA
+        MANILA_OPTGROUP_gamma_share_driver: manila.tests.share.drivers.dummy.DummyDriver
+      devstack_local_conf:
+        test-config:
+          "$TEMPEST_CONFIG":
+            share:
+              backend_names: ALPHA,BETA
+              backend_replication_type: readable
+              build_timeout: 180
+              capability_sg_consistent_snapshot_support: pool
+              create_networks_when_multitenancy_enabled: false
+              enable_ip_rules_for_protocols: nfs
+              enable_ro_access_level_for_protocols: nfs,cifs
+              enable_user_rules_for_protocols: cifs
+              multi_backend: true
+              multitenancy_enabled: true
+              run_driver_assisted_migration_tests: true
+              run_manage_unmanage_snapshot_tests: true
+              run_manage_unmanage_tests: true
+              run_migration_with_preserve_snapshots_tests: true
+              run_mount_snapshot_tests: true
+              run_replication_tests: true
+              run_revert_to_snapshot_tests: true
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index b7df12c..2c0639c 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -4,8 +4,9 @@
       - tempest-plugin-jobs
     check:
       jobs:
+        - manila-tempest-plugin-dummy-no-dhss
+        - manila-tempest-plugin-dummy-dhss
         - manila-tempest-plugin-lvm
-        - manila-tempest-minimal-dsvm-dummy
         - manila-tempest-plugin-zfsonlinux:
             voting: false
         - manila-tempest-plugin-cephfs-native:
@@ -19,7 +20,8 @@
     gate:
       queue: manila
       jobs:
-        - manila-tempest-minimal-dsvm-dummy
+        - manila-tempest-plugin-dummy-no-dhss
+        - manila-tempest-plugin-dummy-dhss
         - manila-tempest-plugin-lvm
     experimental:
       jobs: