From 735a2d271f7965ea9a97cf1db588b15bbf0131ca Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <tkajinam@redhat.com>
Date: Sun, 4 Sep 2022 02:28:39 +0900
Subject: [PATCH] Add basic manila-tempest-plugin options

This change introduces a few basic manila-tempest-plugin options which
are required to test Manila in integration jobs.

Change-Id: I76fc72f37a9237f023eb58b37f4b67e698c440f9
---
 manifests/init.pp                               | 17 +++++++++++++++++
 .../manila-plugin-opts-32ed62c7b964c19b.yaml    | 10 ++++++++++
 spec/classes/tempest_init_spec.rb               |  4 ++++
 3 files changed, 31 insertions(+)
 create mode 100644 releasenotes/notes/manila-plugin-opts-32ed62c7b964c19b.yaml

diff --git a/manifests/init.pp b/manifests/init.pp
index ecd256a2..7653ecfa 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -245,6 +245,14 @@
 #   Defaults to $::os_service_default
 #  [*load_balancer_test_with_noop*]
 #   Defaults to $::os_service_default
+#  [*share_multitenancy_enabled*]
+#   Defaults to $::os_service_default
+#  [*share_enable_protocols*]
+#   Defaults to $::os_service_default
+#  [*share_multi_backend*]
+#   Defaults to $::os_service_default
+#  [*share_capability_storage_protocol*]
+#   Defaults to $::os_service_default
 #
 # DEPREACTED PARAMETERS
 #  [*glance_v1*]
@@ -404,6 +412,11 @@ class tempest(
   $load_balancer_observer_role        = $::os_service_default,
   $load_balancer_global_observer_role = $::os_service_default,
   $load_balancer_test_with_noop       = $::os_service_default,
+  # manila options
+  $share_multitenancy_enabled         = $::os_service_default,
+  $share_enable_protocols             = $::os_service_default,
+  $share_multi_backend                = $::os_service_default,
+  $share_capability_storage_protocol  = $::os_service_default,
   # DEPRECATED PARAMETERS
   $glance_v1                          = undef,
   $glance_v2                          = undef,
@@ -614,6 +627,10 @@ class tempest(
     'load_balancer/observer_role':                     value => $load_balancer_observer_role;
     'load_balancer/global_observer_role':              value => $load_balancer_global_observer_role;
     'load_balancer/test_with_noop':                    value => $load_balancer_test_with_noop;
+    'share/multitenancy_enabled':                      value => $share_multitenancy_enabled;
+    'share/enable_protocols':                          value => join(any2array($share_enable_protocols), ',');
+    'share/multi_backend':                             value => $share_multi_backend;
+    'share/capability_storage_protocol':               value => $share_capability_storage_protocol;
   }
 
   oslo::concurrency { 'tempest_config': lock_path => $lock_path }
diff --git a/releasenotes/notes/manila-plugin-opts-32ed62c7b964c19b.yaml b/releasenotes/notes/manila-plugin-opts-32ed62c7b964c19b.yaml
new file mode 100644
index 00000000..d394241f
--- /dev/null
+++ b/releasenotes/notes/manila-plugin-opts-32ed62c7b964c19b.yaml
@@ -0,0 +1,10 @@
+---
+features:
+  - |
+    The following three parameters for manila-tempest-plugin have been added
+    to the ``tempest`` class.
+
+    - ``share_multitenancy_enabled``
+    - ``share_enable_protocols``
+    - ``share_multi_backend``
+    - ``capability_storage_protocol``
diff --git a/spec/classes/tempest_init_spec.rb b/spec/classes/tempest_init_spec.rb
index bf8b4426..fc8ea078 100644
--- a/spec/classes/tempest_init_spec.rb
+++ b/spec/classes/tempest_init_spec.rb
@@ -284,6 +284,10 @@ describe 'tempest' do
           is_expected.to contain_tempest_config('load_balancer/observer_role').with(:value => '<SERVICE DEFAULT>')
           is_expected.to contain_tempest_config('load_balancer/global_observer_role').with(:value => '<SERVICE DEFAULT>')
           is_expected.to contain_tempest_config('load_balancer/test_with_noop').with(:value => '<SERVICE DEFAULT>')
+          is_expected.to contain_tempest_config('share/multitenancy_enabled').with(:value => '<SERVICE DEFAULT>')
+          is_expected.to contain_tempest_config('share/enable_protocols').with(:value => '<SERVICE DEFAULT>')
+          is_expected.to contain_tempest_config('share/multi_backend').with(:value => '<SERVICE DEFAULT>')
+          is_expected.to contain_tempest_config('share/capability_storage_protocol').with(:value => '<SERVICE DEFAULT>')
           is_expected.to contain_tempest_config('cli/cli_dir').with(:value => nil)
           is_expected.to contain_oslo__concurrency('tempest_config').with(
             :lock_path => '/var/lib/tempest'