File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,12 +177,6 @@ cd /opt/bosh/bosh-stemcell
177177OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rake spec:shellout_types
178178```
179179
180- If on macOS, run:
181-
182- ``` shell
183- OSX=true OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rake spec:shellout_types
184- ```
185-
186180### How to run tests for BOSH Linux Stemcell Builder
187181
188182The BOSH Linux Stemcell Builder code itself can be tested with the following command's:
Original file line number Diff line number Diff line change 11require 'spec_helper'
22
33context 'helpers.sh' do
4+ before do
5+ skip "This spec requires linux" unless RUBY_PLATFORM . downcase . include? ( "linux" )
6+ end
47
58 context 'add_on_exit runs cleanup commands in LIFO order' do
69 describe ShelloutTypes ::Command . new (
Original file line number Diff line number Diff line change 33require 'shellout_types/chroot'
44require 'tmpdir'
55
6+ def supported_testing_os?
7+ RUBY_PLATFORM . downcase . include? ( "linux" )
8+ end
69
710RSpec . configure do |config |
811 if config . inclusion_filter [ :shellout_types ]
12+ config . before ( :suite ) do
13+ raise "Running 'shellout_types' specs on '#{ RUBY_PLATFORM } ' is not supported" unless supported_testing_os?
14+ end
15+
916 if ENV [ 'OS_IMAGE' ]
1017 @os_image_dir = Dir . mktmpdir ( 'os-image-rspec' )
1118 ShelloutTypes ::Chroot . chroot_dir = @os_image_dir
1522 Bosh ::Core ::Shell . new . run ( "sudo tar zxf #{ ENV [ 'OS_IMAGE' ] } -C #{ config . os_image_dir } " )
1623 Bosh ::Core ::Shell . new . run ( "sudo chgrp -Rh $(id -g) #{ config . os_image_dir } " )
1724 Bosh ::Core ::Shell . new . run ( "sudo chmod 775 #{ config . os_image_dir } " )
18- if ENV [ 'OSX' ]
19- Bosh ::Core ::Shell . new . run ( "sudo chroot #{ config . os_image_dir } /bin/bash -c \" useradd --uid $(id -u) -G nogroup shellout\" " )
20- else
21- Bosh ::Core ::Shell . new . run ( "sudo chroot #{ config . os_image_dir } /bin/bash -c 'useradd -G nogroup shellout'" )
22- end
25+ Bosh ::Core ::Shell . new . run ( "sudo chroot #{ config . os_image_dir } /bin/bash -c 'useradd -G nogroup shellout'" )
2326 end
2427
2528 config . after ( :suite ) do
You can’t perform that action at this time.
0 commit comments