Sha256: 99be6e3481fe94e1fc3cf3adc1333c34fbf8be73421365f4c82fb3b5dd29bf8a

Contents?: true

Size: 1 KB

Versions: 16

Compression:

Stored size: 1 KB

Contents

test_name 'use the exec subcommand' do
  def delete_root_folder_contents
    on default, 'rm -rf /root/* /root/.beaker'
  end

  step 'ensure the workspace is clean' do
    delete_root_folder_contents
  end

  step 'run init and provision to set up the system' do
    on default, 'beaker init --hosts centos6-64; beaker provision'
    subcommand_state = on(default, 'cat .beaker/.subcommand_state.yaml').stdout
    subcommand_state = YAML.parse(subcommand_state).to_ruby
    assert_equal(true, subcommand_state['provisioned'])
  end

  step 'create a test dir and populate it with tests' do
    on default, 'mkdir -p testing_dir'
  end

  step 'create remote test file' do
    testfile = <<-TESTFILE
    on(agents, 'echo hello world')
    TESTFILE
    create_remote_file(default, '/root/testing_dir/testfile1.rb', testfile)
  end

  step 'specify that remote file with beaker exec' do
    result = on(default, 'beaker exec testing_dir/testfile1.rb --log-level verbose')
    assert_match(/hello world/, result.stdout)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
beaker-6.4.1 acceptance/tests/subcommands/exec.rb
beaker-6.4.0 acceptance/tests/subcommands/exec.rb
beaker-6.3.0 acceptance/tests/subcommands/exec.rb
beaker-6.2.0 acceptance/tests/subcommands/exec.rb
beaker-6.1.0 acceptance/tests/subcommands/exec.rb
beaker-5.8.1 acceptance/tests/subcommands/exec.rb
beaker-5.8.0 acceptance/tests/subcommands/exec.rb
beaker-5.7.0 acceptance/tests/subcommands/exec.rb
beaker-5.6.0 acceptance/tests/subcommands/exec.rb
beaker-5.5.0 acceptance/tests/subcommands/exec.rb
beaker-5.4.0 acceptance/tests/subcommands/exec.rb
beaker-5.3.1 acceptance/tests/subcommands/exec.rb
beaker-5.3.0 acceptance/tests/subcommands/exec.rb
beaker-5.2.0 acceptance/tests/subcommands/exec.rb
beaker-5.1.0 acceptance/tests/subcommands/exec.rb
beaker-5.0.0 acceptance/tests/subcommands/exec.rb