facter-statistax 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfebc916b1502a0bd25654320f6885d39b33a1d6509135f71e825757f22d2dad
4
- data.tar.gz: f9abe23783aea7ac47d75d7bad3b314c0d78ed115239f54eb1c2844e46abcad7
3
+ metadata.gz: 3b3f8d40994d9934ce13ad3822519991575fc5ebcaac1e3fe0bf3b7ec6ac9d85
4
+ data.tar.gz: 482282b3b1d5b675ecc5214138c0eb7f225878d43168e35d95838e962c6d2061
5
5
  SHA512:
6
- metadata.gz: dddcac5c15042c84ce148a4f619d80f92985eafdb25be5e59b03d4bb2eb9917fb51bce6acef206783f8f4bbde42f15248d8f53844c430260c68785f9a36549f7
7
- data.tar.gz: 49eef55cb003d2a6533ed841417ac4dd9b0498379de77de485ae8f51e3547bea3d0f798aac47749cbc75938d97e175f68329a7b90ea1edce906a760cc2645f20
6
+ metadata.gz: 25d27374a7773f73f0ae9da571987c3e3c113230a06188bf4b70a1a0d7931a925b5f7c15bb4a69dbc43f902bbfc18141014ed7adb0d1ada9307cda33c803dfdb
7
+ data.tar.gz: feeaee3eb200b3359649161d53a791b9249c262edc8a96f6e503bc2f9aed0b89d815348b366c5ef391e1d2b3688a4bf4a0e047385fd8409af52e09a9a62ac19f
@@ -1,7 +1,6 @@
1
1
  AllCops:
2
2
  Include:
3
3
  - 'lib/**/*.rb'
4
- - 'acceptance/**/*.rb'
5
4
  - 'bin/*.rb'
6
5
  - 'config/*.rb'
7
6
  - 'scripts/*.rb'
data/Gemfile CHANGED
@@ -7,5 +7,5 @@ gem 'fileutils'
7
7
  gem 'rubysl-open3'
8
8
  gem 'json'
9
9
  gem 'pry'
10
- gem 'rubocop'
10
+ gem 'rubocop', '~> 0.73.0'
11
11
  gem 'rubycritic'
@@ -5,16 +5,13 @@
5
5
  is working with puppet agent >= 6.0.x)
6
6
  3. ```export GEM_VERSION=2.5.5``` - gem facter version you want to test (if this env variable isn't set, the latest
7
7
  version will be downloaded)
8
- 4. ```export IS_GEM=true\false``` - it will indicate which facter to test ruby\cpp version (if this isn't set, cpp
9
- facter will be tested)
10
- 5. Modify config.json from acceptance directory to meet your testing needs
11
- 6. To test using vmpooler:\
8
+ 4. Modify config.json from acceptance directory to meet your testing needs
9
+ 5. To test using vmpooler:\
12
10
  ```beaker-hostgenerator redhat7-64a-debian9-64a > hosts.yaml```\
13
11
  ```beaker init -h hosts.yaml --options-file config/aio/options.rb```\
14
12
  To test using nspooler you have to require the vm from nspooler first, then:\
15
13
  ```beaker-hostgenerator centos6-64a-solaris11-SPARC\{hypervisor=none\,hostname=$THE_HOST_NSPOOLER_PROVIDED\} > hosts.yaml```\
16
14
  ```bundle exec beaker init --hosts hosts.yaml --options-file config/aio/options.rb```
17
- 7. ```bundle exec beaker provision```
18
- 8. ```bundle exec beaker exec pre-suite --pre-suite presuite/01_install_puppet_agent.rb,presuite/02_install_facter_statistax.rb,presuite/03_install_facter_gem.rb --preserve-state```
19
- 9. Before this step you can set/unset ```IS_GEM env``` variable to meet your test needs\
20
- ```bundle exec beaker exec run/run_statistax.rb```
15
+ 6. ```bundle exec beaker provision```
16
+ 7. ```bundle exec beaker exec pre-suite --pre-suite presuite/01_install_puppet_agent.rb,presuite/02_install_facter_statistax.rb,presuite/03_install_facter_gem.rb --preserve-state```
17
+ 8. ```bundle exec beaker exec run/run_statistax.rb```
@@ -0,0 +1,5 @@
1
+ pwd
2
+ cd ../../facter-ng
3
+ gem build facter-ng.gemspec
4
+ mv facter-ng-*.gem ../facter-statistax/acceptance
5
+ cd ../facter-statistax/acceptance
@@ -2,22 +2,126 @@
2
2
  {
3
3
  "test_run":"TestRun1",
4
4
  "runs":[
5
+ {
6
+ "fact": "aio_agent_version",
7
+ "repetitions": 10
8
+ },
9
+ {
10
+ "fact": "augeas",
11
+ "repetitions": 10
12
+ },
13
+ {
14
+ "fact": "disks",
15
+ "repetitions": 10
16
+ },
17
+ {
18
+ "fact":"dmi",
19
+ "repetitions":10
20
+ },
21
+ {
22
+ "fact": "facterversion",
23
+ "repetitions": 10
24
+ },
25
+ {
26
+ "fact":"filesystems",
27
+ "repetitions":10
28
+ },
29
+ {
30
+ "fact": "hypervisors",
31
+ "repetitions": 10
32
+ },
33
+ {
34
+ "fact":"identity",
35
+ "repetitions":10
36
+ },
37
+ {
38
+ "fact":"is_virtual",
39
+ "repetitions":10
40
+ },
41
+ {
42
+ "fact":"kernel",
43
+ "repetitions":10
44
+ },
45
+ {
46
+ "fact":"kernelmajversion",
47
+ "repetitions":10
48
+ },
49
+ {
50
+ "fact":"kernelrelease",
51
+ "repetitions":10
52
+ },
53
+ {
54
+ "fact":"kernelversion",
55
+ "repetitions":10
56
+ },
57
+ {
58
+ "fact":"load_averages",
59
+ "repetitions":10
60
+ },
61
+ {
62
+ "fact":"memory",
63
+ "repetitions":10
64
+ },
65
+ {
66
+ "fact":"networking",
67
+ "repetitions":10
68
+ },
5
69
  {
6
70
  "fact":"os",
7
- "repetitions":3
71
+ "repetitions":10
72
+ },
73
+ {
74
+ "fact":"path",
75
+ "repetitions":10
8
76
  },
9
77
  {
10
78
  "fact":"processors",
11
- "repetitions":1
79
+ "repetitions":10
80
+ },
81
+ {
82
+ "fact":"ruby",
83
+ "repetitions":10
84
+ },
85
+ {
86
+ "fact":"solaris_zones",
87
+ "repetitions":10
88
+ },
89
+ {
90
+ "fact":"ssh",
91
+ "repetitions":10
92
+ },
93
+ {
94
+ "fact":"system_uptime",
95
+ "repetitions":10
96
+ },
97
+ {
98
+ "fact":"timezone",
99
+ "repetitions":10
12
100
  },
13
101
  {
14
102
  "fact":"virtual",
15
- "repetitions":3
103
+ "repetitions":10
104
+ },
105
+ {
106
+ "fact":"zfs_featurenumbers",
107
+ "repetitions":10
108
+ },
109
+ {
110
+ "fact":"zfs_version",
111
+ "repetitions":10
112
+ },
113
+ {
114
+ "fact":"zpool_featurenumbers",
115
+ "repetitions":10
116
+ },
117
+ {
118
+ "fact":"zpool_version",
119
+ "repetitions":10
16
120
  },
17
121
  {
18
- "fact":"all",
19
- "repetitions":3
122
+ "fact": "all",
123
+ "repetitions": 10
20
124
  }
21
125
  ]
22
126
  }
23
- ]
127
+ ]
@@ -2,13 +2,16 @@
2
2
 
3
3
  test_name 'Install facter gem' do
4
4
  agents.each do |agent|
5
- facter_gem = File.join(Pathname.new(File.expand_path('..', __dir__)), 'facter-ng-0.0.10.gem')
5
+ current_dir = Pathname.new(File.expand_path('..', __dir__))
6
+ facter_ng_gem = Dir.entries(current_dir).select { |file| file =~ /facter-ng-[0-9]+.[0-9]+.[0-9]+.gem/ }
7
+ facter_gem = File.join(current_dir, facter_ng_gem)
6
8
  home_dir = on(agent, 'pwd').stdout.chop
7
9
 
8
10
  scp_to agent, facter_gem, home_dir
9
11
 
10
12
  gem_c = gem_command(agent)
11
- on agent, "#{gem_c} install -f facter-ng-0.0.10.gem"
13
+ on agent, "#{gem_c} uninstall facter-ng"
14
+ on agent, "#{gem_c} install -f facter-ng-*.gem"
12
15
  if agent['platform'] =~ /windows/
13
16
  puppetbin_path = '"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/puppet/bin":"/cygdrive/c/Program Files/Puppet Labs/Puppet/puppet/bin"'
14
17
  on agent, %( echo 'export PATH=$PATH:#{puppetbin_path}' > /etc/bash.bashrc )
@@ -3,9 +3,32 @@
3
3
  require 'pathname'
4
4
  test_name 'Run facter statistax' do
5
5
  agents.each do |agent|
6
- is_gem = ENV['IS_GEM'] || 'false'
6
+ is_gem = 'false'
7
7
  home_dir = on(agent, 'pwd').stdout.chop
8
- step 'Run facter statistax' do
8
+
9
+ step 'Run facter statistax for Cfacter' do
10
+ content = ::File.read(File.join(Pathname.new(File.expand_path('..', __dir__)), 'config.json'))
11
+ create_remote_file(agent, "#{home_dir}/config.json", content)
12
+ if agent['platform'] =~ /windows/
13
+ puppetbin_path = '"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/puppet/bin":"/cygdrive/c/Program Files/Puppet Labs/Puppet/puppet/bin"'
14
+ on agent, %( echo 'export PATH=$PATH:#{puppetbin_path}' > /etc/bash.bashrc )
15
+ on agent, "statistax.bat config.json #{is_gem}"
16
+ else
17
+ on agent, "statistax #{home_dir}/config.json #{is_gem}"
18
+ end
19
+ end
20
+
21
+ step 'Save output' do
22
+ host_dir = File.join(Pathname.new(File.expand_path('..', __dir__)), "log_dir/#{agent['platform']}")
23
+
24
+ out_dir = File.join(host_dir, 'cpp')
25
+
26
+ FileUtils.mkdir_p(out_dir)
27
+ scp_from agent, "#{home_dir}/log/output.json", out_dir
28
+ end
29
+
30
+ step 'Run facter statistax for facter-ng' do
31
+ is_gem = 'true'
9
32
  content = ::File.read(File.join(Pathname.new(File.expand_path('..', __dir__)), 'config.json'))
10
33
  create_remote_file(agent, "#{home_dir}/config.json", content)
11
34
  if agent['platform'] =~ /windows/
@@ -20,11 +43,9 @@ test_name 'Run facter statistax' do
20
43
  step 'Save output' do
21
44
  host_dir = File.join(Pathname.new(File.expand_path('..', __dir__)), "log_dir/#{agent['platform']}")
22
45
 
23
- out_dir = if is_gem == 'true'
24
- File.join(host_dir, 'gem')
25
- else
26
- File.join(host_dir, 'cpp')
27
- end
46
+ out_dir = File.join(host_dir, 'cpp')
47
+
48
+ FileUtils.mkdir_p(out_dir)
28
49
  scp_from agent, "#{home_dir}/log/output.json", out_dir
29
50
  end
30
51
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FacterStatistax
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
@@ -12,7 +12,12 @@ if ARGV[0].to_s == 'false'
12
12
  require '/opt/puppetlabs/puppet/lib/libfacter.so'
13
13
  end
14
14
  elsif Gem.win_platform?
15
- require 'C:\Program Files\Puppet Labs\Puppet\puppet\lib\ruby\gems\2.5.0\gems\facter-ng-4.0.0\lib\facter-ng.rb'
15
+ gems_path = 'C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/gems'
16
+ ruby_version = Dir.entries(gems_path).select { |file| file =~ /[0-9]+.[0-9]+.[0-9]+/ }
17
+ facter_ng_path = File.join(gems_path, ruby_version, 'gems')
18
+ facter_ng_version = Dir.entries(facter_ng_path).select { |file| file =~ /facter-ng-4/ }
19
+ facter_ng_path = File.join(facter_ng_path, facter_ng_version, 'lib', 'facter-ng.rb')
20
+ require facter_ng_path
16
21
  else
17
22
  require 'facter-ng'
18
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter-statistax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -84,6 +84,7 @@ files:
84
84
  - acceptance/.beaker.yml
85
85
  - acceptance/Gemfile
86
86
  - acceptance/README.md
87
+ - acceptance/build_and_move_gem.sh
87
88
  - acceptance/config.json
88
89
  - acceptance/config/aio/options.rb
89
90
  - acceptance/lib/helper.rb
@@ -91,7 +92,6 @@ files:
91
92
  - acceptance/presuite/01_install_puppet_agent.rb
92
93
  - acceptance/presuite/02_install_facter_statistax.rb
93
94
  - acceptance/presuite/03_install_facter_gem.rb
94
- - acceptance/run/run_facter_ng.rb
95
95
  - acceptance/run/run_statistax.rb
96
96
  - acceptance/run/uninstall_facter_gem.rb
97
97
  - acceptance/run/uninstall_puppet_agent.rb
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.0.1
131
+ rubygems_version: 3.0.6
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Facter-Statistax, benchmark for facter
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- test_name 'Run facter-ng gem' do
4
- agents.each do |agent|
5
- ruby = ruby_command(agent)
6
- if agent['platform'] =~ /windows/
7
- puppetbin_path = '"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/puppet/bin":"/cygdrive/c/Program Files/Puppet Labs/Puppet/puppet/bin"'
8
- on agent, %( echo 'export PATH=$PATH:#{puppetbin_path}' > /etc/bash.bashrc )
9
- end
10
- # on agent, 'cd "C:\Program Files\Puppet Labs\Puppet\puppet\lib\ruby\gems\2.5.0\gems\facter-0.0.1"'
11
- on(agent, 'pwd').stdout.chop
12
- # on agent, ruby.to_s + ' "C:\Program Files\Puppet Labs\Puppet\puppet\lib\ruby\gems\2.5.0\gems\facter-0.0.1\bin\facter"'
13
- on agent, ruby.to_s + ' /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/facter-0.0.1/bin/facter'
14
- on agent, 'facter'
15
- end
16
- end