sshkit 1.21.4 → 1.21.5

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: 42ea735e4b1e6b51eb99c2699ecc11579229fffe3db99cec9afe4e819f466bf0
4
- data.tar.gz: 74af7dc3101e5bb9853449f5ffc1f3de4a0ad0a3d19f5554540e3eff3e4f99d7
3
+ metadata.gz: 45797b636d02d174676019185c1199342f1ca21f8b72c09acd1cbebf44bb9263
4
+ data.tar.gz: fc271769aefc5c107ff1c406a54d3d085d062d8a24dbd0946b9763170f338d19
5
5
  SHA512:
6
- metadata.gz: 1d78e3c1a8e8c875b5eef3f3951540817e82cd4ed07e84ddec648f5b6b85d9c38b09493ab476d5a2e728b44d62e56d1d5b5cadd5359c422371f9a1d8773e3b7c
7
- data.tar.gz: 5f7cdad196d09216c388d8ba95feb65f1299c3fc5deda5ebf7adbf95630621592011f1ebb64fe0405017aa6ebc5a5a73e42852e3b4d90cb865585a08f2ff3031
6
+ metadata.gz: 30396905e750c8f3a82466eb90486eb0287bd716db6762fa9cdb67953369f42decbb44c19915983253286d57cc8a7ba061c05c5cc06f623fcdc884473af7fc1d
7
+ data.tar.gz: 6d15cb5f1d640fec3767d7a1130fe2ce5c723364b9e1678b94baeb55994bb2978de03e1790aca017f894efbd4b8f29d5b02556967cbbebcea43e31ea360d599f
@@ -1,14 +1,14 @@
1
1
  name: test on CI
2
2
  on:
3
3
  push:
4
- branches: [ master ]
4
+ branches: [master]
5
5
  pull_request:
6
6
  jobs:
7
7
  test:
8
8
  runs-on: ubuntu-latest
9
9
  strategy:
10
10
  matrix:
11
- ruby: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head" ]
11
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head"]
12
12
  steps:
13
13
  - uses: actions/checkout@v3
14
14
  - name: Set up Ruby
@@ -19,6 +19,33 @@ jobs:
19
19
  - name: Run tests
20
20
  run: bundle exec rake test:units
21
21
 
22
+ test-legacy:
23
+ runs-on: ubuntu-20.04
24
+ strategy:
25
+ matrix:
26
+ ruby: ["2.0", "2.1", "2.2"]
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler-cache: true
34
+ - name: Run tests
35
+ run: bundle exec rake test:units
36
+
37
+ test-all:
38
+ runs-on: ubuntu-latest
39
+ needs: [test, test-legacy]
40
+ if: always()
41
+ steps:
42
+ - name: All tests ok
43
+ if: ${{ !(contains(needs.*.result, 'failure')) }}
44
+ run: exit 0
45
+ - name: Some tests failed
46
+ if: ${{ contains(needs.*.result, 'failure') }}
47
+ run: exit 1
48
+
22
49
  rubocop:
23
50
  runs-on: ubuntu-latest
24
51
  steps:
@@ -32,20 +59,34 @@ jobs:
32
59
  run: bundle exec rake lint
33
60
 
34
61
  functional:
35
- runs-on: macos-10.15
62
+ runs-on: macos-12
36
63
  strategy:
37
64
  matrix:
38
- ruby: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head" ]
65
+ ruby:
66
+ [
67
+ "2.0",
68
+ "2.1",
69
+ "2.2",
70
+ "2.3",
71
+ "2.4",
72
+ "2.5",
73
+ "2.6",
74
+ "2.7",
75
+ "3.0",
76
+ "3.1",
77
+ "3.2",
78
+ "head",
79
+ ]
39
80
  steps:
40
81
  - uses: actions/checkout@v3
41
82
 
42
83
  - name: Cache Vagrant boxes
43
- uses: actions/cache@v2
84
+ uses: actions/cache@v3
44
85
  with:
45
86
  path: ~/.vagrant.d/boxes
46
- key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
87
+ key: ${{ runner.os }}-vagrant-v2-${{ hashFiles('Vagrantfile') }}
47
88
  restore-keys: |
48
- ${{ runner.os }}-vagrant-
89
+ ${{ runner.os }}-vagrant-v2-
49
90
 
50
91
  - name: Run vagrant up
51
92
  run: vagrant up
@@ -58,3 +99,15 @@ jobs:
58
99
 
59
100
  - name: Run functional tests
60
101
  run: bundle exec rake test:functional
102
+
103
+ functional-all:
104
+ runs-on: ubuntu-latest
105
+ needs: [functional]
106
+ if: always()
107
+ steps:
108
+ - name: All tests ok
109
+ if: ${{ !(contains(needs.*.result, 'failure')) }}
110
+ run: exit 0
111
+ - name: Some tests failed
112
+ if: ${{ contains(needs.*.result, 'failure') }}
113
+ run: exit 1
@@ -7,6 +7,6 @@ jobs:
7
7
  steps:
8
8
  - uses: actions/checkout@master
9
9
  - name: Draft Release
10
- uses: toolmantim/release-drafter@v5.22.0
10
+ uses: toolmantim/release-drafter@v5.24.0
11
11
  env:
12
12
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/Vagrantfile CHANGED
@@ -1,10 +1,14 @@
1
1
  VAGRANTFILE_API_VERSION = "2"
2
2
 
3
3
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4
- config.vm.box = 'hashicorp/precise64'
4
+ config.vm.box = 'bento/ubuntu-22.10'
5
+
6
+ config.vm.boot_timeout = 600 # seconds
7
+ config.ssh.insert_key = false
5
8
  config.vm.provision "shell", inline: <<-SHELL
6
9
  echo 'ClientAliveInterval 3' >> /etc/ssh/sshd_config
7
10
  echo 'ClientAliveCountMax 3' >> /etc/ssh/sshd_config
11
+ echo 'MaxAuthTries 6' >> /etc/ssh/sshd_config
8
12
  service ssh restart
9
13
  SHELL
10
14
 
@@ -1,3 +1,3 @@
1
1
  module SSHKit
2
- VERSION = "1.21.4".freeze
2
+ VERSION = "1.21.5".freeze
3
3
  end
@@ -75,14 +75,14 @@ module SSHKit
75
75
 
76
76
  def test_group_netssh
77
77
  Netssh.new(a_host) do
78
- as user: :root, group: :admin do
78
+ as user: :root, group: :root do
79
79
  execute :touch, 'restart.txt'
80
80
  end
81
81
  end.run
82
82
  command_lines = @output.lines.select { |line| line.start_with?('Command:') }
83
83
  assert_equal [
84
84
  "Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n",
85
- "Command: sudo -u root -- sh -c sg\\ admin\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
85
+ "Command: sudo -u root -- sh -c sg\\ root\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
86
86
  ], command_lines
87
87
  end
88
88
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.4
4
+ version: 1.21.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Hambley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-20 00:00:00.000000000 Z
12
+ date: 2023-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  requirements: []
294
- rubygems_version: 3.4.7
294
+ rubygems_version: 3.4.13
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby