sshkit 1.21.4 → 1.21.6

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: c02076e3d45e9cc2eeac09d86836d8d76b957e62effe234e8f35cc946097683a
4
+ data.tar.gz: 748296139afb794afe86828c674a8bb41b8e080f77b8c65d3120b2c8842b481e
5
5
  SHA512:
6
- metadata.gz: 1d78e3c1a8e8c875b5eef3f3951540817e82cd4ed07e84ddec648f5b6b85d9c38b09493ab476d5a2e728b44d62e56d1d5b5cadd5359c422371f9a1d8773e3b7c
7
- data.tar.gz: 5f7cdad196d09216c388d8ba95feb65f1299c3fc5deda5ebf7adbf95630621592011f1ebb64fe0405017aa6ebc5a5a73e42852e3b4d90cb865585a08f2ff3031
6
+ metadata.gz: f62b86ebfe3ff109d1cb6445b0a361256a5b316320706acda4a2c57cf160b8ee37086060ad15f21063e809a8b07549b01a5c92c5210e18694b88e6249ea6602f
7
+ data.tar.gz: 58e77e7514508a4c8bcbfa4f1d5b789079da62cd2ffaee7de81c38efcd2760a47f8b61049a8c284e9193ca9d1cbdc8a31fadc48c7513f9e3cec7156dd172ab6c
@@ -1,16 +1,16 @@
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
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
@@ -19,10 +19,37 @@ 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@v4
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:
25
- - uses: actions/checkout@v3
52
+ - uses: actions/checkout@v4
26
53
  - name: Set up Ruby
27
54
  uses: ruby/setup-ruby@v1
28
55
  with:
@@ -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
- - uses: actions/checkout@v3
81
+ - uses: actions/checkout@v4
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.25.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.6".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.6
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-11-17 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.21
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby