Issue #21497 has been updated by Adrien Thebo.

Category set to library
Status changed from Unreviewed to Merged - Pending Release
Target version set to 2.0.0

Merged into master in 94b2b17; this should be released in 2.0.0.

----------------------------------------
Feature #21497: OpenBSD: add encrypted swap fact
https://projects.puppetlabs.com/issues/21497#change-95527

* Author: Jasper Lievisse Adriaanse
* Status: Merged - Pending Release
* Priority: Normal
* Assignee: 
* Category: library
* Target version: 2.0.0
* Keywords: facter, openbsd, swap
* Branch: 
* Affected Facter version: 
----------------------------------------
Hi,

Here's a patch that we've had in OpenBSD ports for a while, which checks if the 
swap is encrypted.

It's been working fine in practice, but I'm having some issues writing a test 
for this so I could
properly submit it here...

Running the spec test results in:

  5) Memory facts on OpenBSD should return whether swap is encrypted
     Failure/Error: Facter.fact(:swapencrypted).value.should == true
     Mocha::ExpectationError:
       unexpected invocation: Facter::Util::Resolution.exec('uname -s')
       satisfied expectations:
       - allowed any number of times, not yet invoked: 
#<AnyInstance:Facter::Util::Loader>.load_all(any_parameters)
       - allowed any number of times, invoked 15 times: 
#<Facter::Util::Fact:0x4599ae7fc00>.value(any_parameters)
       - allowed any number of times, not yet invoked: 
Facter::Util::Resolution.exec('sysctl -n vm.swapencrypt.enable')
       - allowed any number of times, not yet invoked: 
Facter::Util::Resolution.exec('sysctl -n hw.physmem')
       - allowed any number of times, not yet invoked: 
Facter::Util::Resolution.exec('vmstat')
       - allowed any number of times, not yet invoked: 
Facter::Util::Resolution.exec('swapctl -s')
     # ./lib/facter/kernel.rb:19:in `block (2 levels) in <top (required)>'
     # ./lib/facter/util/resolution.rb:459:in `call'
     # ./lib/facter/util/resolution.rb:459:in `block in value'
     # ./lib/facter/util/resolution.rb:457:in `value'
     # ./lib/facter/util/resolution.rb:442:in `to_s'
     # ./lib/facter/memory.rb:89:in `block (2 levels) in <top (required)>'
     # ./lib/facter/util/resolution.rb:459:in `call'
     # ./lib/facter/util/resolution.rb:459:in `block in value'
     # ./lib/facter/util/resolution.rb:457:in `value'
     # ./lib/facter/util/fact.rb:137:in `block in find_first_real_value'
     # ./lib/facter/util/fact.rb:136:in `each'
     # ./lib/facter/util/fact.rb:136:in `find_first_real_value'
     # ./lib/facter/util/fact.rb:97:in `block in value'
     # ./lib/facter/util/fact.rb:121:in `searching'
     # ./lib/facter/util/fact.rb:94:in `value'
     # ./spec/unit/memory_spec.rb:214:in `block (3 levels) in <top (required)>

My diff is at: 
https://github.com/jasperla/facter/commit/2afc223a97680264cd34e9f1835984deac3a23c5
(On an unrelated note, sysctl -n does what the cut(1) magic was doing for 
hw.physmem.)

If someone could help me sort out the spec test, I'll turn the aforementioned 
commit into a proper pull request.

Thanks.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to