cem_acpt 0.2.11-universal-java-17 → 0.3.1-universal-java-17

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: c97a0886b1604384a7e03f5edec960b594842f69502e5b1fcd4d2a6a18ecb3fc
4
- data.tar.gz: 8ad5f879c25f70d0050ec0f7fd24891339b7a80271193d2549e8a6a7224d7727
3
+ metadata.gz: f977844689308ecaf3b9002e6665ad973a79eb6c0c0c728ceeb1423dbc83e62c
4
+ data.tar.gz: d38363d98ecc2a895932f239acc9d7de6d23090898c1822924a7ec6385a1abdd
5
5
  SHA512:
6
- metadata.gz: 2279fa0e8ab932d0f02982cf8cacf6aaf4bf8c0a5e709eeb7e3cd0d093a4712f501c175f2a57f64cd0c441e56fa0c51e4238ab1a196d89037f719194981536a1
7
- data.tar.gz: 76ca3f9c58e4f1450b3e442b0edc825b68ea5b533796b34e90963630dc219731238128f44dbe1267979199d06efa1a3cef99913318bb3684af663e377ec8b97f
6
+ metadata.gz: 41ec4792a70f45c501fd7c5c3de8f93bed4ee409e6ccea1f00d67aa1037338a9ba0cb005f87b4618cf8e412a9f6abdfdfd8d3bf6442e9fc9db573b021177cb69
7
+ data.tar.gz: 111909e4ceb4470d0853af023d1da617e0c3deda96a1e2cdb73a959979e316a16d00678b28c0c29e5720ef08e4e846a803a01ad6eecc0c0857cf234a0250cb4c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_acpt (0.2.11-universal-java-17)
4
+ cem_acpt (0.3.1-universal-java-17)
5
5
  concurrent-ruby (>= 1.1, < 2.0)
6
6
  deep_merge (>= 1.2, < 2.0)
7
7
  ed25519 (>= 1.2, < 2.0)
@@ -19,8 +19,8 @@ GEM
19
19
  ed25519 (1.3.0-java)
20
20
  minitar (0.9)
21
21
  multi_json (1.15.0)
22
- net-scp (1.2.1)
23
- net-ssh (>= 2.6.5)
22
+ net-scp (4.0.0)
23
+ net-ssh (>= 2.6.5, < 8.0.0)
24
24
  net-ssh (7.0.1)
25
25
  net-telnet (0.1.1)
26
26
  parallel (1.22.1)
@@ -68,7 +68,7 @@ GEM
68
68
  rspec-its
69
69
  specinfra (~> 2.83.1)
70
70
  sfl (2.3)
71
- specinfra (2.83.3)
71
+ specinfra (2.83.4)
72
72
  net-scp
73
73
  net-ssh (>= 2.7)
74
74
  net-telnet (= 0.1.1)
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  rubocop
86
86
 
87
87
  BUNDLED WITH
88
- 2.3.15
88
+ 2.3.25
@@ -62,8 +62,8 @@ module CemAcpt
62
62
  end
63
63
 
64
64
  def clean_up_test_suite(opts)
65
- @ctx&.node_inventory&.clear!
66
- @ctx&.node_inventory&.clean_local_files
65
+ @ctx&.node_inventory&.clear! unless opts[:no_destroy_nodes]
66
+ @ctx&.node_inventory&.clean_local_files unless opts[:no_destroy_nodes]
67
67
  clean_test_ssh_key unless opts[:no_ephemeral_ssh_key]
68
68
  @run_handler&.destroy_test_nodes
69
69
  @keep_terminal_alive&.kill
@@ -242,7 +242,7 @@ module CemAcpt::Platform::Gcp
242
242
  apply_cmd << "--hiera_config=#{opts[:apply][:hiera_config]}" if opts[:apply][:hiera_config]
243
243
  apply_cmd << '--debug' if opts[:apply][:debug]
244
244
  apply_cmd << '--noop' if opts[:apply][:noop]
245
- apply_cmd << '--detailed-exitcodes' if opts[:apply][:detailed_exitcodes]
245
+ apply_cmd << '--detailed-exitcodes' if opts[:apply][:detailed_exit_codes]
246
246
 
247
247
  run_shell(
248
248
  instance_name,
@@ -337,7 +337,10 @@ module CemAcpt::Platform::Gcp
337
337
 
338
338
  # This function returns the currently authenticated user's name sanitized for use in SSH
339
339
  def authenticated_user_name
340
- local_exec('compute os-login describe-profile', project_flag: false)['posixAccounts'][0]['username']
340
+ profile = local_exec('compute os-login describe-profile', project_flag: false)
341
+ accounts = profile['posixAccounts']
342
+ raise "cannot find any posix accounts in profile: #{profile}" if not accounts
343
+ accounts[0]['username']
341
344
  rescue StandardError => e
342
345
  raise "failed to find authenticated user name from os-login profile: #{e.message}"
343
346
  end
@@ -81,5 +81,14 @@ module Platform
81
81
  def run_shell(instance_name, cmd, opts = {})
82
82
  command_provider.run_shell(instance_name, cmd, opts)
83
83
  end
84
+
85
+ # Uploads a file to the given instance
86
+ # @param instance_name [String] the name of the instance to upload the file to
87
+ # @param local [String] the local file path
88
+ # @param remote [String] the remote file path
89
+ # @return [String] the output of the upload file command
90
+ def scp_upload(instance_name, local, remote)
91
+ command_provider.scp_upload(instance_name, local, remote)
92
+ end
84
93
  end
85
94
  end
@@ -144,6 +144,12 @@ module CemAcpt
144
144
  result
145
145
  end
146
146
 
147
+ # This method uploads a file to the test node.
148
+ def scp_upload(local, remote)
149
+ host = RSpec.configuration.acpt_test_data[:node_name]
150
+ RSpec.configuration.acpt_test_data[:platform].scp_upload(host, local, remote)
151
+ end
152
+
147
153
  # This method runs a shell command on the test node.
148
154
  def run_shell(cmd, opts = {})
149
155
  cmd = cmd.join(' ') if cmd.is_a?(Array)
@@ -33,14 +33,16 @@ module CemAcpt
33
33
  # @return [Array<Hash>] an array of test data hashes
34
34
  def acceptance_test_data
35
35
  logger.info 'Gathering acceptance test data...'
36
- acceptance_tests.each_with_object([]) do |t, a|
37
- logger.debug("Processing #{t}...")
38
- test_name = File.basename(t, '_spec.rb')
36
+ raise "No 'tests' entry found in config file" unless @config.has?('tests')
37
+ @config.get('tests').each_with_object([]) do |test_name, a|
38
+ logger.debug("Processing test #{test_name}...")
39
+ test_file = acceptance_tests.find { |f| File.basename(f, '_spec.rb') == test_name }
40
+ raise "Test file not found for test #{test_name}" unless test_file
41
+ logger.debug("Test file found for test #{test_name}: #{test_file}")
39
42
  test_data = {
40
43
  test_name: test_name,
41
- test_file: File.expand_path(t),
44
+ test_file: File.expand_path(test_file),
42
45
  }
43
- next unless @config.has?('tests') && @config.get('tests').include?(test_name)
44
46
 
45
47
  process_for_each(test_data).each do |test_data_i|
46
48
  process_static_vars(test_data_i)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemAcpt
4
- VERSION = '0.2.11'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_acpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.3.1
5
5
  platform: universal-java-17
6
6
  authors:
7
7
  - puppetlabs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2022-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement