Add start of line to log level config check regex 93/55593/1
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 2 Feb 2016 20:32:49 +0000 (15:32 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 19 Apr 2017 19:18:40 +0000 (15:18 -0400)
When checking custom log level config, verify that the config starts the
line, and therefore that it's not commented out.

Change-Id: I00acfdb3ce432d8d855e202a026b7085315c6bb5
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
spec/spec_helper.rb
spec/spec_helper_acceptance.rb

index 99fd958cadcad771bd657866b93d841edcbac90a..c5e927a23b96856dd7587491889fa4402a1239d6 100644 (file)
@@ -181,7 +181,7 @@ def log_level_tests(options = {})
           'path'        => '/opt/opendaylight/etc/org.ops4j.pax.logging.cfg',
           'owner'   => 'odl',
           'group'   => 'odl',
-          'content'     => /log4j.logger.#{logger} = #{level}/
+          'content'     => /^log4j.logger.#{logger} = #{level}/
         )
       }
     end
index 4e21c4d5722d0d4dac82dedb21d0340db71e990e..7823a75e572273e9632137d0d807f163e0bbbd1c 100644 (file)
@@ -269,7 +269,7 @@ def log_level_validations(options = {})
         it { should be_file }
         it { should be_owned_by 'odl' }
         it { should be_grouped_into 'odl' }
-        its(:content) { should match /log4j.logger.#{logger} = #{level}/ }
+        its(:content) { should match /^log4j.logger.#{logger} = #{level}/ }
       end
     end
   end