Skip to content

Commit

Permalink
[ci] version dependent registry url in 0200-check_docker_registry
Browse files Browse the repository at this point in the history
* Bail out from 0200-check_docker_registry.ts if OBS version prior 2.8
* Use docker registry shipped with appliance in 2.9
* Use OBS internal registry if OBS >= 2.10
  • Loading branch information
M0ses authored and coolo committed Nov 14, 2018
1 parent ed212a2 commit 145cb47
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions dist/t/osc/0200-check_docker_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,34 @@ use warnings;

my $tests = 2;
use Test::More;
use FindBin;
use JSON::XS;

plan tests => $tests;

BEGIN {
unshift @INC, "/usr/lib/obs/server";
unshift @::INC,
"/usr/lib/obs/server",
"$FindBin::Bin/../lib",
"$FindBin::Bin/../../../src/backend/build",
"/usr/lib/build"
;
};

use JSON::XS;
use OBS::Test::Utils;
use Build::Rpm;

my $obs_version = OBS::Test::Utils::get_package_version('obs-server', 2);
my $vcmp = Build::Rpm::verscmp($obs_version, "2.9");

BAIL_OUT("Container registry not support in OBS prior 2.9") if ($vcmp < 0);

my $registry_url = ($vcmp)
? 'https://localhost/v2'
: 'https://localhost:444/v2' # url for separate registry in obs 2.9.x
;

print "Using registry_url '$registry_url'\n";

# These test need a lot of resources, so they should be
# skipable
Expand Down Expand Up @@ -52,7 +73,7 @@ SKIP: {
my $repo;
while (1) {
$timeout--;
my $response = `curl https://localhost/v2/_catalog 2>/dev/null`;
my $response = `curl $registry_url/_catalog 2>/dev/null`;
my $json = decode_json($response);
if ( $json->{repositories}->[0]) {
$repo = $json->{repositories}->[0];
Expand Down

0 comments on commit 145cb47

Please sign in to comment.