asa_console 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/LICENSE.md +1 -1
- data/README.md +6 -6
- data/asa_console.gemspec +3 -3
- data/lib/asa_console.rb +6 -0
- metadata +34 -34
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZGFkZjI4YjZlNTc3OTExYmY0YTA2MGFmYjc2YWVlZDk3Nzk3NzFlMw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b477c5a5fb64782e7e28b0bbbc42651ea52c6cdd
|
4
|
+
data.tar.gz: 3b1571a5b3869d040ca63436be31c1923228ab66
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZTFiN2I2MjAzZTUxNTYzNDUxYzU1N2I5MGJlNTZhNThjNWJkYmRlNzk4NzQz
|
11
|
-
M2I1YWExNGExZWE3YzZhZjM2YTQ2MmQyNWYzZDQ2NjQyMTU0OWU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTE2YTQ4NTJjZGUzMTU2MzkyZWY4YTVhMGVlOGM3YzhhMTQzMDUzOGViZTIz
|
14
|
-
YzY0MzMzNzFhMjJjOTY2M2JkMGIzYmZiOWRhZGZlYWRjYTI4NDlhYjQ5NmQy
|
15
|
-
MWM1MjFmNDkwYmUwMjMzNGQ0ODZkMmY4ZDU1M2Y4ZTgzODVmN2Y=
|
6
|
+
metadata.gz: 3670886be70a95509e52a50a95b2aae1a765c3ede4783d523e3be3cd18d4b5f36bbfd6cccd8e45b6c7740ddd901087765010b411d28fc9b1edda3252e7a49f3c
|
7
|
+
data.tar.gz: a43b4654fbe6cf83f57b0893e6106d526a1403277183acc98add3d835d0b375e0d92334d3f3ddbc99ab7431aa6ce6272901ae6c8532c78483cbdf68003bb8d69
|
data/LICENSE.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
=====================
|
3
3
|
|
4
|
-
Copyright (c) 2015 Henry Goodman
|
4
|
+
Copyright (c) 2015-2016 Henry Goodman
|
5
5
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ The easiest way to get started is to browse through the test files in the [scrip
|
|
27
27
|
|
28
28
|
Each script executes a series of commands declared in a block as show below. The test runner displays output as it would appear in an SSH session and adds color to indicate how the output is being parsed. Informational messages can be added to the output with the `log` method.
|
29
29
|
|
30
|
-
|
30
|
+
~~~ ruby
|
31
31
|
ASAConsole::Test.script do |asa|
|
32
32
|
log 'Connecting...'
|
33
33
|
asa.connect
|
@@ -39,7 +39,7 @@ ASAConsole::Test.script do |asa|
|
|
39
39
|
log 'Disconnecting...'
|
40
40
|
asa.disconnect
|
41
41
|
end
|
42
|
-
|
42
|
+
~~~
|
43
43
|
|
44
44
|
The included test scripts are designed to be non-invasive and to leave the device configuration in its original state. Nevertheless, running them in a production environment is not recommended.
|
45
45
|
|
@@ -69,17 +69,17 @@ Configuration Files
|
|
69
69
|
|
70
70
|
The `asatest` executable will read a list of default command line options from the file `~/.asa-console/test_options.yaml`. Here is an example of the file format:
|
71
71
|
|
72
|
-
|
72
|
+
~~~ yaml
|
73
73
|
---
|
74
74
|
show-session-log: true
|
75
75
|
color: light
|
76
|
-
|
76
|
+
~~~
|
77
77
|
|
78
78
|
Each key matches a long-form command line option with the leading "--" removed. Run the program with "--help" for a complete list.
|
79
79
|
|
80
80
|
Device information is needed for running live tests. By default, the program will look for appliance information in `~/.asa-console/test_appliances.yaml`. Here is an example of the file format:
|
81
81
|
|
82
|
-
|
82
|
+
~~~ yaml
|
83
83
|
---
|
84
84
|
default_appliance: firewall002
|
85
85
|
appliances:
|
@@ -93,7 +93,7 @@ appliances:
|
|
93
93
|
user: testuser
|
94
94
|
password: execpass
|
95
95
|
enable_password: enablepass
|
96
|
-
|
96
|
+
~~~
|
97
97
|
|
98
98
|
If any of the following options are not found in this file, the user will be prompted to enter values for them.
|
99
99
|
|
data/asa_console.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'asa_console'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.3'
|
5
5
|
s.summary = 'Cisco ASA management via an interactive terminal session'
|
6
6
|
s.description = 'This gem lets a program interact with a Cisco ASA using CLI
|
7
7
|
commands. It includes a minimal set of functions for issuing commands and
|
@@ -18,10 +18,10 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_runtime_dependency('highline', '~> 1.7')
|
19
19
|
|
20
20
|
s.add_development_dependency('bundler', '~> 1.7')
|
21
|
+
s.add_development_dependency('kramdown', '~> 1.9')
|
21
22
|
s.add_development_dependency('rake', '~> 10.4')
|
22
|
-
s.add_development_dependency('redcarpet', '~> 3.3')
|
23
23
|
s.add_development_dependency('rspec', '~> 3.4')
|
24
|
-
s.add_development_dependency('rubocop', '~> 0.35')
|
24
|
+
s.add_development_dependency('rubocop', '~> 0.35.1')
|
25
25
|
s.add_development_dependency('simplecov', '~> 0.11')
|
26
26
|
s.add_development_dependency('thor', '~> 0.19')
|
27
27
|
s.add_development_dependency('yard', '~> 0.8')
|
data/lib/asa_console.rb
CHANGED
@@ -195,7 +195,13 @@ class ASAConsole
|
|
195
195
|
def priv_exec(command)
|
196
196
|
must_be_connected!
|
197
197
|
enable! if @terminal.prompt =~ EXEC_PROMPT
|
198
|
+
last_prompt = @terminal.prompt
|
198
199
|
output = send(command, PRIV_EXEC_PROMPT)
|
200
|
+
|
201
|
+
# A prompt change may indicate a context switch or other event that would
|
202
|
+
# invalidate the config cache.
|
203
|
+
@running_config = {} if @terminal.prompt != last_prompt
|
204
|
+
|
199
205
|
error = CMD_ERROR_REGEX.match(output)
|
200
206
|
fail Error::CommandError, "Error output after executing '#{command}': #{error[1]}" if error
|
201
207
|
output
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asa_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Goodman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.9.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.9.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.7'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: kramdown
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '10.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '10.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.4'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.35.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.35.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0.11'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.11'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: thor
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - ~>
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0.19'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - ~>
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0.19'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: yard
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - ~>
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0.8'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - ~>
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.8'
|
153
153
|
description: This gem lets a program interact with a Cisco ASA using CLI commands.
|
@@ -158,7 +158,7 @@ executables:
|
|
158
158
|
extensions: []
|
159
159
|
extra_rdoc_files: []
|
160
160
|
files:
|
161
|
-
- .yardopts
|
161
|
+
- ".yardopts"
|
162
162
|
- LICENSE.md
|
163
163
|
- README.md
|
164
164
|
- asa_console.gemspec
|
@@ -191,17 +191,17 @@ require_paths:
|
|
191
191
|
- lib
|
192
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- -
|
194
|
+
- - ">="
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: 1.9.3
|
197
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.5.
|
204
|
+
rubygems_version: 2.5.1
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Cisco ASA management via an interactive terminal session
|