cucumber-sshd 0.1.1 → 0.2.0

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
  SHA1:
3
- metadata.gz: 684bb8bd0c9b308074543353ea3f1640b6300e50
4
- data.tar.gz: 254a0172671f7b40b61d77d0292cf10d6749d583
3
+ metadata.gz: d8c42d85efd2d4544f53874155c6783962b787bf
4
+ data.tar.gz: 1f97b487978497e8fed3344cdeb1f44561fa74e5
5
5
  SHA512:
6
- metadata.gz: 05595a18a651a66497e025a3429bcf5a9e9e5b0e4625ad51be3f5ca56d2c800ae824a80a07454d4ed0a6001d8b0ea2955aaa03a3cf464aefe2bdaeaa8c98969b
7
- data.tar.gz: a7d594a0edee638f643a6200afc9efd99bf6fe60693b2d197cb046d227765cebae9bda4161d4ba2b556077d6c4ac536d916feefd16150ae846d644f316cae4d9
6
+ metadata.gz: 0ba0edca046f6168f43fa4ddf6e87b2ac7ae0bce656f969b0252823ab5a559e32913dc844060de03587369639b8165d30f568c4eaf54e0beac6a23a50bd527e1
7
+ data.tar.gz: 305688bb83a5a7060b55295b939065a2e07f2f853472797d2582204509d8c96137d06b45c52d89b30d6da503d66754c58f324546456f7a176de0d571b5c12108
data/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ Copyright 2013 Thibault Jouan. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the
13
+ distribution.
14
+
15
+ * Neither the name of the software nor the names of its contributors
16
+ may be used to endorse or promote products derived from this
17
+ software without specific prior written permission.
18
+
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND
21
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS
24
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ cucumber-sshd
2
+ =============
3
+
4
+ This ruby gem runs a "fake" sshd process for testing purpose in
5
+ cucumber scenario tagged as `@sshd`. It is especially useful when
6
+ testing programs with aruba, like a provisioning program that would
7
+ connect through ssh for example.
8
+
9
+ The process is real, but the HOME environment variable will be
10
+ modified as aruba current directory, and the port changed so an
11
+ unprivileged can open it. Host key pair is hard coded, output is
12
+ silenced, server will only listen on localhost with sftp enabled, and
13
+ a standard ssh config file is written in `.ssh/config`.
14
+
15
+ Optionally, cucumber process will block until sshd accepts
16
+ connection, and the same sshd process can also be configured to
17
+ persist across the whole test suite for faster run.
18
+
19
+
20
+ Warning
21
+ -------
22
+
23
+ * no test coverage
24
+ * pollute cucumber contexts with multiple instance variables
25
+ * pollute global context with a variable
26
+ * uses `Kernel#at_exit` when `wait_ready` option is enabled
27
+
28
+
29
+ Usage
30
+ -----
31
+
32
+ ### cucumber config
33
+
34
+ ```ruby
35
+ Before do
36
+ # Persists the sshd process across tests (default is to start and
37
+ # stop around each test).
38
+ @_sshd_fast = true
39
+
40
+ # Block cucumber process until sshd accepts new connections.
41
+ @_sshd_wait_ready = true
42
+ end
43
+ require 'cucumber/sshd/cucumber'
44
+ ```
45
+
46
+ ### runtime config
47
+
48
+ You can control the host name and the port with environment variables.
49
+ Here are the defaults:
50
+
51
+ SSHD_TEST_HOST=some_host.test
52
+ SSHD_TEST_PORT=2222
@@ -108,7 +108,7 @@ HostKey #{File.expand_path base_path}/#{KEY_PATH}
108
108
  PidFile /dev/null
109
109
  UsePrivilegeSeparation no
110
110
  Subsystem sftp /usr/libexec/sftp-server
111
- ForceCommand HOME=#{File.expand_path base_path} sh -c "cd ~; $SSH_ORIGINAL_COMMAND"
111
+ ForceCommand HOME=#{File.expand_path base_path} sh -c "cd ~; [ -f .ssh/rc ] && . .ssh/rc; $SSH_ORIGINAL_COMMAND"
112
112
  eoh
113
113
 
114
114
  write_file SSH_CONFIG_PATH, <<-eoh
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module SSHD
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-sshd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
11
+ date: 2015-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -32,6 +32,8 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - ".gitignore"
34
34
  - Gemfile
35
+ - LICENSE
36
+ - README.md
35
37
  - cucumber-sshd.gemspec
36
38
  - lib/cucumber/sshd.rb
37
39
  - lib/cucumber/sshd/cucumber.rb
@@ -56,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
58
  version: '0'
57
59
  requirements: []
58
60
  rubyforge_project:
59
- rubygems_version: 2.2.2
61
+ rubygems_version: 2.4.5
60
62
  signing_key:
61
63
  specification_version: 4
62
64
  summary: Cucumber sshd helpers