Skip to content

Commit ddbc975

Browse files
committed
[Isolated] Test python pacakges are installed when in an ADC region
1 parent 29ba943 commit ddbc975

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cookbooks/aws-parallelcluster-platform/spec/unit/recipes/cookbook_virtualenv_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
cached(:python_version) { 'python_version' }
77
cached(:system_pyenv_root) { 'system_pyenv_root' }
88
cached(:virtualenv_path) { 'system_pyenv_root/versions/python_version/envs/cookbook_virtualenv' }
9+
cached(:aws_region) { 'us-iso-test' }
910

1011
context "when cookbook virtualenv not installed yet" do
1112
cached(:chef_run) do
1213
runner = runner(platform: platform, version: version) do |node|
14+
allow_any_instance_of(Object).to receive(:aws_region).and_return(aws_region)
1315
node.override['cluster']['system_pyenv_root'] = system_pyenv_root
1416
node.override['cluster']['python-version'] = python_version
17+
node.override['cluster']['region'] = aws_region
1518
end
1619
runner.converge(described_recipe)
1720
end
@@ -32,6 +35,15 @@
3235
expect(node.default['cluster']['cookbook_virtualenv_path']).to eq(virtualenv_path)
3336
is_expected.to write_node_attributes('dump node attributes')
3437
end
38+
context "when in isolated region" do
39+
it 'installs python packages' do
40+
is_expected.to run_bash("pip install").with(
41+
user: 'root',
42+
group: 'root',
43+
cwd: "#{node['cluster']['base_dir']}"
44+
).with_code(/tar xzf cookbook-dependencies.tgz/)
45+
end
46+
end
3547
end
3648
end
3749
end

0 commit comments

Comments
 (0)