-
Notifications
You must be signed in to change notification settings - Fork 24
(FACT-2531) Fix for tests/facts/validate_file_system_size_bytes.rb #500
Conversation
b9abfd8
to
691cbca
Compare
lib/resolvers/processors_resolver.rb
Outdated
dirs = Dir.entries('/sys/devices/system/cpu').reject { |dir| dir =~ /\.+/ } | ||
|
||
dirs.count { |dir| dir =~ /cpu[0-9]+$/ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use count directly, as you are passing a block and counting specific entries:
Dir.entries('/sys/devices/system/cpu').count { |dir| dir =~ /cpu[0-9]+$/ }
Also maybe the method name can be more suggestive: physical_devices_count
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/facts/debian/architecture.rb
Outdated
@@ -10,6 +10,7 @@ class Architecture | |||
def call_the_resolver | |||
fact_value = Facter::Resolvers::Uname.resolve(:machine) | |||
fact_value = 'amd64' if fact_value == 'x86_64' | |||
fact_value = fact_value =~ /i[3456]86|pentium/ ? 'i386' : fact_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fact_value = i386 if `fact_value =~ /i[3456]86|pentium/
You already have a good value in fact_value
change it only if you need to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/facts/linux/os/architecture.rb
Outdated
@@ -10,6 +10,8 @@ class Architecture | |||
def call_the_resolver | |||
fact_value = Facter::Resolvers::Uname.resolve(:machine) | |||
|
|||
fact_value = fact_value =~ /i[3456]86|pentium/ ? 'i386' : fact_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as on lib/facts/debian/architecture.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -19,7 +19,7 @@ def read_mount(fact_name) | |||
@fact_list[:mountpoints] = {} | |||
output = Facter::Core::Execution.execute('mount', logger: log) | |||
output.split("\n").map do |line| | |||
next if line =~ /\snode\s|---|procfs|ahafs/ | |||
next if line =~ /node|---|procfs|ahafs/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change covered in tests? i don't see aix/mountpoints_spec.rb to have changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change is in fixtures/mount
Would be useful to describe in the commit message what this fixes, as the PR title states is fixing an acceptance tests but is not clear what was the issue. |
Description of the problem:
Description of the fix:
This PR solves: tests/facts/validate_file_system_size_bytes.rb test for all oses that have mountpoints fact and os_processors_and_kernel test for all oses.