Disable OF statics polling
[integration/packaging/puppet-opendaylight.git] / spec / spec_helper_acceptance.rb
index 5611026019e83b70eaea436c63e076c8186b05d6..517c1739da44704778c2b5ecce9d5a4f4af4dece 100644 (file)
@@ -69,6 +69,7 @@ def install_odl(options = {})
   tls_keystore_password = options.fetch(:tls_keystore_password, 'dummypass')
   log_mechanism = options.fetch(:log_mechanism, 'file')
   inherit_dscp_marking = options.fetch(:inherit_dscp_marking, false)
+  stats_polling_enabled = options.fetch(:stats_polling_enabled, false)
 
   # Build script for consumption by Puppet apply
   it 'should work idempotently with no errors' do
@@ -94,6 +95,7 @@ def install_odl(options = {})
       tls_keystore_password => #{tls_keystore_password},
       log_mechanism => #{log_mechanism},
       inherit_dscp_marking => #{inherit_dscp_marking},
+      stats_polling_enabled => #{stats_polling_enabled},
     }
     EOS
 
@@ -574,3 +576,18 @@ def tls_validations(options = {})
     its(:content) { should match /<Property name="jetty.secure.port" default="#{odl_rest_port}" \/>/ }
   end
 end
+
+# Shared function for validations related to OVS statistics polling
+def stats_polling_validations(options = {})
+  # NB: This param default should match the one used by the opendaylight
+  #   class, which is defined in opendaylight::params
+  # TODO: Remove this possible source of bugs^^
+
+  stats_polling_enabled = options.fetch(:stats_polling_enabled, false)
+  describe file('/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg') do
+    it { should be_file }
+    it { should be_owned_by 'odl' }
+    it { should be_grouped_into 'odl' }
+    its(:content) { should match /is-statistics-polling-on=#{stats_polling_enabled}/ }
+  end
+end