Skip to content

Commit

Permalink
ONEOCPDEPL-43: Get rid of private OSD script
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Podhradsky <[email protected]>
  • Loading branch information
apodhrad committed Jan 20, 2021
1 parent 5525e71 commit b36e6e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 5 additions & 1 deletion lib/launchers/ocm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 1 addition & 9 deletions lib/launchers/ocm_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b36e6e3

Please sign in to comment.