diff --git a/lib/launchers/ocm.rb b/lib/launchers/ocm.rb index 5c15c842b5..a21bcf6094 100644 --- a/lib/launchers/ocm.rb +++ b/lib/launchers/ocm.rb @@ -155,7 +155,11 @@ def generate_json(name) # download the script 'osd-provision.sh' which takes care of the OSD installation/uninstallation def download_osd_script - osd_repo_uri = ENV['GIT_OSD_URI'] || 'https://gitlab.cee.redhat.com/mk-bin-packing/mk-performance-tests.git' + if ENV['GIT_OSD_URI'] + osd_repo_uri = ENV['GIT_OSD_URI'] + else + raise "You need to define env variable 'GIT_OSD_URI'" + end osd_repo_dir = File.join(Dir.tmpdir, 'osd_repo') FileUtils.rm_rf(osd_repo_dir) git = BushSlicer::Git.new(uri: osd_repo_uri, dir: osd_repo_dir) diff --git a/lib/launchers/ocm_test.rb b/lib/launchers/ocm_test.rb index 61003a966f..46f6f46130 100644 --- a/lib/launchers/ocm_test.rb +++ b/lib/launchers/ocm_test.rb @@ -22,6 +22,7 @@ def setup ENV['AWS_ACCESS_KEY'] = nil ENV['AWS_SECRET_KEY'] = nil ENV['AWS_SECRET_ACCESS_KEY'] = nil + ENV['GIT_OSD_URI'] = nil end # def teardown @@ -98,15 +99,6 @@ def test_generating_json_with_nodes assert_equal('{"name":"myosd4","managed":true,"multi_az":false,"byoc":false,"nodes":{"compute":8}}', json) end - def test_downloading_osd_script - options = { :token => "abc" } - ocm = BushSlicer::OCM.new(options) - osd_script = ocm.download_osd_script - assert(File.exists?(osd_script), "File 'osd-provision.sh' was not downloaded") - content = File.read(osd_script) - assert_match(/.*ocm.*/, content) - end - def test_executing_shell hello_script = "/tmp/hello.sh" File.write(hello_script, "#!/bin/sh\n[[ -z \"$1\" ]] && echo \"Specify a name!\" && exit 1; for i in {1..3}; do echo \"Hello $1\"; sleep 5; done")