diff --git a/metadata.rb b/metadata.rb index 7a59a41..f538843 100644 --- a/metadata.rb +++ b/metadata.rb @@ -19,8 +19,6 @@ depends 'openstack-compute', '>= 18.0.0' depends 'openstack-block-storage', '>= 18.0.0' depends 'openstackclient' -depends 'poise-python' - issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url) source_url 'https://github.com/openstack/cookbook-openstack-integration-test' if respond_to?(:source_url) chef_version '>= 12.5' if respond_to?(:chef_version) diff --git a/recipes/setup.rb b/recipes/setup.rb index c8d5342..e4eaf3d 100644 --- a/recipes/setup.rb +++ b/recipes/setup.rb @@ -83,20 +83,19 @@ connection_params = { end end +include_recipe 'openstack-common' + tempest_path = '/opt/tempest' venv_path = '/opt/tempest-venv' -python_virtualenv venv_path do - pip_version '18.0' - setuptools_version '40.0.0' - wheel_version '0.31.1' +execute "virtualenv #{venv_path}" do + creates venv_path end -python_execute 'install tempest' do +execute 'install tempest' do action :nothing - command '-m pip install .' + command "#{venv_path}/bin/pip install ." cwd tempest_path - virtualenv venv_path end git tempest_path do @@ -104,7 +103,7 @@ git tempest_path do reference '17.2.0' depth 1 action :sync - notifies :run, 'python_execute[install tempest]', :immediately + notifies :run, 'execute[install tempest]', :immediately end template "#{venv_path}/tempest.sh" do diff --git a/spec/setup_spec.rb b/spec/setup_spec.rb index 9092fbd..0b57052 100644 --- a/spec/setup_spec.rb +++ b/spec/setup_spec.rb @@ -91,6 +91,18 @@ describe 'openstack-integration-test::setup' do ) end + it do + expect(chef_run).to run_execute('virtualenv /opt/tempest-venv').with(creates: '/opt/tempest-venv') + end + + it do + expect(chef_run).to nothing_execute('install tempest') + .with( + command: '/opt/tempest-venv/bin/pip install .', + cwd: '/opt/tempest' + ) + end + it 'syncs /opt/tempest from github' do expect(chef_run).to sync_git( '/opt/tempest' @@ -101,6 +113,10 @@ describe 'openstack-integration-test::setup' do ) end + it do + expect(chef_run.git('/opt/tempest')).to notify('execute[install tempest]').to(:run).immediately + end + it 'uploads image1' do expect(chef_run).to upload_openstack_image_image('image1').with( identity_user: 'admin',