Revision f370cc85
Added by Thomas McKay over 6 years ago
test/resources/content_hosts_test.rb | ||
---|---|---|
8 | 8 |
set_user 'admin' |
9 | 9 |
|
10 | 10 |
stdout,stderr = capture { |
11 |
hammer.run(%W{csv content-hosts --help}) |
|
11 |
hammer.run(%W{--reload-cache csv content-hosts --help})
|
|
12 | 12 |
} |
13 | 13 |
assert_equal '', stderr |
14 | 14 |
assert_equal stdout, <<-HELP |
... | ... | |
41 | 41 |
file.rewind |
42 | 42 |
|
43 | 43 |
stdout,stderr = capture { |
44 |
hammer.run(%W{csv content-hosts --verbose --file #{file.path}}) |
|
44 |
hammer.run(%W{--reload-cache csv content-hosts --verbose --file #{file.path}})
|
|
45 | 45 |
} |
46 | 46 |
assert_equal '', stderr |
47 | 47 |
assert_equal stdout[0..-2], "Creating content host '#{@hostname}'...done" |
... | ... | |
49 | 49 |
file.rewind |
50 | 50 |
|
51 | 51 |
stdout,stderr = capture { |
52 |
hammer.run(%W{csv content-hosts --verbose --file #{file.path}}) |
|
52 |
hammer.run(%W{--reload-cache csv content-hosts --verbose --file #{file.path}})
|
|
53 | 53 |
} |
54 | 54 |
assert_equal '', stderr |
55 | 55 |
assert_equal stdout[0..-2], "Updating content host '#{@hostname}'...done" |
56 | 56 |
file.unlink |
57 | 57 |
|
58 | 58 |
stdout,stderr = capture { |
59 |
hammer.run(%W(host list --search name=#{@hostname})) |
|
59 |
hammer.run(%W(--reload-cache host list --search name=#{@hostname}))
|
|
60 | 60 |
} |
61 | 61 |
assert_equal '', stderr |
62 | 62 |
assert_equal stdout.split("\n").length, 5 |
... | ... | |
72 | 72 |
set_user 'admin' |
73 | 73 |
|
74 | 74 |
stdout,stderr = capture { |
75 |
hammer.run(%W{csv content-hosts --export --organization Test\ Corporation}) |
|
75 |
hammer.run(%W{--reload-cache csv content-hosts --export --organization Test\ Corporation})
|
|
76 | 76 |
} |
77 | 77 |
assert_equal '', stderr |
78 | 78 |
assert_equal stdout.split("\n")[0], "Name,Organization,Environment,Content View,Host Collections,Virtual,Host,OS,Arch,Sockets,RAM,Cores,SLA,Products,Subscriptions" |
... | ... | |
84 | 84 |
set_user 'admin' |
85 | 85 |
|
86 | 86 |
stdout,stderr = capture { |
87 |
hammer.run(%W{csv content-hosts --export --itemized-subscriptions --organization Test\ Corporation}) |
|
87 |
hammer.run(%W{--reload-cache csv content-hosts --export --itemized-subscriptions --organization Test\ Corporation})
|
|
88 | 88 |
} |
89 | 89 |
assert_equal '', stderr |
90 | 90 |
|
... | ... | |
95 | 95 |
end |
96 | 96 |
end |
97 | 97 |
|
98 |
class TestContentHostsImport < MiniTest::Unit::TestCase
|
|
98 |
class TestContentHostsSingle < MiniTest::Unit::TestCase
|
|
99 | 99 |
# import a single line, testing that subscription is added |
100 | 100 |
def test_import_single_line |
101 | 101 |
start_vcr |
... | ... | |
111 | 111 |
file.rewind |
112 | 112 |
|
113 | 113 |
stdout,stderr = capture { |
114 |
hammer.run(%W{csv content-hosts --verbose --file #{file.path}}) |
|
114 |
hammer.run(%W{--reload-cache csv content-hosts --verbose --file #{file.path}})
|
|
115 | 115 |
} |
116 | 116 |
assert_equal '', stderr |
117 | 117 |
assert_equal "Creating content host '#{@hostname}'...done\n", stdout |
118 | 118 |
|
119 | 119 |
stdout,stderr = capture { |
120 |
hammer.run(%W{csv content-hosts --export --organization Test\ Corporation}) |
|
120 |
hammer.run(%W{--reload-cache csv content-hosts --export --organization Test\ Corporation})
|
|
121 | 121 |
} |
122 | 122 |
assert_equal '', stderr |
123 | 123 |
lines = stdout.split("\n") |
Also available in: Unified diff
fixes #16501 - subnets import not setting proxies
Changed the vcr recording by adding --reload-cache to all the hammer commands. This hopefully will avoid the intermittent failures due to fetching the v2.json.