|
9 | 9 | before :each do
|
10 | 10 | end
|
11 | 11 |
|
| 12 | + describe '#list' do |
| 13 | + it 'skips empty platforms and lists aws' do |
| 14 | + stub_request(:get, "http://foo/status/platforms/vmpooler"). |
| 15 | + to_return(:status => 200, :body => "", :headers => {}) |
| 16 | + stub_request(:get, "http://foo/status/platforms/ondemand_vmpooler"). |
| 17 | + to_return(:status => 200, :body => "", :headers => {}) |
| 18 | + stub_request(:get, "http://foo/status/platforms/nspooler"). |
| 19 | + to_return(:status => 200, :body => "", :headers => {}) |
| 20 | + body = '{ |
| 21 | + "aws_platforms": [ |
| 22 | + "amazon-6-x86_64", |
| 23 | + "amazon-7-x86_64", |
| 24 | + "amazon-7-arm64", |
| 25 | + "centos-7-x86-64-west", |
| 26 | + "redhat-8-arm64" |
| 27 | + ] |
| 28 | + }' |
| 29 | + stub_request(:get, "http://foo/status/platforms/aws"). |
| 30 | + to_return(:status => 200, :body => body, :headers => {}) |
| 31 | + |
| 32 | + |
| 33 | + results = ABS.list(false, "http://foo") |
| 34 | + |
| 35 | + expect(results).to include("amazon-6-x86_64", "amazon-7-x86_64", "amazon-7-arm64", "centos-7-x86-64-west", "redhat-8-arm64") |
| 36 | + end |
| 37 | + it 'legacy JSON string, prior to PR 306' do |
| 38 | + stub_request(:get, "http://foo/status/platforms/vmpooler"). |
| 39 | + to_return(:status => 200, :body => "", :headers => {}) |
| 40 | + stub_request(:get, "http://foo/status/platforms/ondemand_vmpooler"). |
| 41 | + to_return(:status => 200, :body => "", :headers => {}) |
| 42 | + stub_request(:get, "http://foo/status/platforms/nspooler"). |
| 43 | + to_return(:status => 200, :body => "", :headers => {}) |
| 44 | + body = '{ |
| 45 | + "aws_platforms": "[\"amazon-6-x86_64\",\"amazon-7-x86_64\",\"amazon-7-arm64\",\"centos-7-x86-64-west\",\"redhat-8-arm64\"]" |
| 46 | + }' |
| 47 | + stub_request(:get, "http://foo/status/platforms/aws"). |
| 48 | + to_return(:status => 200, :body => body, :headers => {}) |
| 49 | + |
| 50 | + results = ABS.list(false, "http://foo") |
| 51 | + |
| 52 | + expect(results).to include("amazon-6-x86_64", "amazon-7-x86_64", "amazon-7-arm64", "centos-7-x86-64-west", "redhat-8-arm64") |
| 53 | + end |
| 54 | + end |
| 55 | + |
12 | 56 | describe '#format' do
|
13 | 57 | it 'returns an hash formatted like a vmpooler return, plus the job_id' do
|
14 | 58 | job_id = "generated_by_floaty_12345"
|
|
0 commit comments