runcible 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/runcible/base.rb +24 -11
- data/lib/runcible/resources/user.rb +0 -2
- data/lib/runcible/version.rb +1 -1
- data/test/integration/fixtures/vcr_cassettes/pulp_user.yml +276 -160
- data/test/integration/fixtures/vcr_cassettes/pulp_user_helper.yml +361 -129
- data/test/integration/test_runner.rb +16 -8
- metadata +3 -3
@@ -14,7 +14,7 @@ require 'minitest/unit'
|
|
14
14
|
require 'minitest/autorun'
|
15
15
|
|
16
16
|
require 'test/integration/vcr_setup'
|
17
|
-
require 'lib/runcible/base'
|
17
|
+
require './lib/runcible/base'
|
18
18
|
|
19
19
|
|
20
20
|
class CustomMiniTestRunner
|
@@ -55,7 +55,7 @@ class PulpMiniTestRunner
|
|
55
55
|
def run_tests(options={})
|
56
56
|
mode = options[:mode] || "recorded"
|
57
57
|
test_name = options[:test_name] || nil
|
58
|
-
auth_type = options[:auth_type] || "
|
58
|
+
auth_type = options[:auth_type] || "http"
|
59
59
|
|
60
60
|
MiniTest::Unit.runner = CustomMiniTestRunner::Unit.new
|
61
61
|
|
@@ -71,22 +71,28 @@ class PulpMiniTestRunner
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def set_runcible_config(auth_type)
|
74
|
-
if auth_type == "
|
75
|
-
Runcible::Base.config = {
|
74
|
+
if auth_type == "http"
|
75
|
+
Runcible::Base.config = {
|
76
|
+
:api_path => "/pulp/api/v2/",
|
77
|
+
:http_auth => {}
|
78
|
+
}
|
76
79
|
|
77
80
|
File.open('/etc/pulp/server.conf') do |f|
|
78
81
|
f.each_line do |line|
|
79
82
|
if line.start_with?('default_password')
|
80
|
-
Runcible::Base.config[:password] = line.split(':')[1].strip
|
83
|
+
Runcible::Base.config[:http_auth][:password] = line.split(':')[1].strip
|
81
84
|
elsif line.start_with?('default_login')
|
82
85
|
Runcible::Base.config[:user] = line.split(':')[1].strip
|
83
86
|
elsif line.start_with?('server_name')
|
84
|
-
Runcible::Base.config[:url] =
|
87
|
+
Runcible::Base.config[:url] = "https://#{line.split(':')[1].chomp.strip}"
|
85
88
|
end
|
86
89
|
end
|
87
90
|
end
|
88
91
|
elsif auth_type == "oauth"
|
89
|
-
Runcible::Base.config = {
|
92
|
+
Runcible::Base.config = {
|
93
|
+
:api_path => "/pulp/api/v2/",
|
94
|
+
:oauth => {}
|
95
|
+
}
|
90
96
|
|
91
97
|
File.open('/etc/pulp/server.conf') do |f|
|
92
98
|
f.each_line do |line|
|
@@ -94,8 +100,10 @@ class PulpMiniTestRunner
|
|
94
100
|
Runcible::Base.config[:oauth][:oauth_secret] = line.split(':')[1].strip
|
95
101
|
elsif line.start_with?('oauth_key')
|
96
102
|
Runcible::Base.config[:oauth][:oauth_key] = line.split(':')[1].strip
|
103
|
+
elsif line.start_with?('default_login')
|
104
|
+
Runcible::Base.config[:user] = line.split(':')[1].strip
|
97
105
|
elsif line.start_with?('server_name')
|
98
|
-
Runcible::Base.config[:url] =
|
106
|
+
Runcible::Base.config[:url] = "https://#{line.split(':')[1].chomp.strip}"
|
99
107
|
end
|
100
108
|
end
|
101
109
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runcible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric D Helms
|