<commit_before>require 'open3'
require 'json'
require 'yaml'

describe 'Bosh - AWS CPI End 2 End tests' do
  before(:all) do
    config_filename = ENV['E2E_CONFIG_FILENAME']            || raise('Missing E2E configuration file')
    configuration = File.open(config_filename) { |f| JSON.parse(f.read) }
    @director_ip = configuration['director_ip']             || raise('missing configuration entry: "director_ip"')
    @manifest_filename = configuration['manifest_filename'] || raise('missing configuration entry: "manifest_filename"')
    @director_username = configuration['director_username'] || raise('missing configuration entry: "director_username"')
    @director_password = configuration['director_password'] || raise('missing configuration entry: "director_password"')
    @stemcell = configuration['stemcell']                   || raise('missing configuration entry: "stemcell"')
    @release = configuration['release']                     || raise('missing configuration entry: "release"')
    @deployment_name = configuration['deployment_name']     || raise('missing configuration entry: "deployment_name"')

    bosh("-n target #{@director_ip}")
    bosh("login #{@director_username} #{@director_password}")
    bosh_uuid = bosh("status --uuid")
    edit_manifest { |manifest| manifest["director_uuid"] = bosh_uuid }
    bosh("upload stemcell #{@stemcell} --skip-if-exists")
    bosh("upload release #{@release} --skip-if-exists")
    bosh("deployment #{@manifest_filename}")
    bosh('-n deploy')
  end

  after(:all) do
    bosh("-n delete deployment #{@deployment_name}")
    bosh('-n cleanup --all')
  end

  context 'with dynamic networking' do
    context 'with IAM instance profile' do
      it 'properly sets IAM instance profile' do
        bosh('run errand iam-instance-profile-test')
      end

      context 'with raw ephemeral disk' do
        it 'properly sets up raw ephemeral disk' do
          bosh('run errand raw-ephemeral-disk-test')
        end
      end
    end
  end
<commit_msg>Strip whitespace from the output of bosh status --uuid<commit_after>require 'open3'
require 'json'
require 'yaml'

describe 'Bosh - AWS CPI End 2 End tests' do
  before(:all) do
    config_filename = ENV['E2E_CONFIG_FILENAME']            || raise('Missing E2E configuration file')
    configuration = File.open(config_filename) { |f| JSON.parse(f.read) }
    @director_ip = configuration['director_ip']             || raise('missing configuration entry: "director_ip"')
    @manifest_filename = configuration['manifest_filename'] || raise('missing configuration entry: "manifest_filename"')
    @director_username = configuration['director_username'] || raise('missing configuration entry: "director_username"')
    @director_password = configuration['director_password'] || raise('missing configuration entry: "director_password"')
    @stemcell = configuration['stemcell']                   || raise('missing configuration entry: "stemcell"')
    @release = configuration['release']                     || raise('missing configuration entry: "release"')
    @deployment_name = configuration['deployment_name']     || raise('missing configuration entry: "deployment_name"')

    bosh("-n target #{@director_ip}")
    bosh("login #{@director_username} #{@director_password}")
    bosh_uuid = bosh("status --uuid")
    edit_manifest { |manifest| manifest["director_uuid"] = bosh_uuid.strip }
    bosh("upload stemcell #{@stemcell} --skip-if-exists")
    bosh("upload release #{@release} --skip-if-exists")
    bosh("deployment #{@manifest_filename}")
    bosh('-n deploy')
  end

  after(:all) do
    bosh("-n delete deployment #{@deployment_name}")
    bosh('-n cleanup --all')
  end

  context 'with dynamic networking' do
    context 'with IAM instance profile' do
      it 'properly sets IAM instance profile' do
        bosh('run errand iam-instance-profile-test')
      end

      context 'with raw ephemeral disk' do
        it 'properly sets up raw ephemeral disk' do
          bosh('run errand raw-ephemeral-disk-test')
        end
      end
    end
  end

{'fraction_non_alphanumeric': 0.12815486400392062, 'fraction_numerical': 0.0019603038470963, 'mean_word_length': 3.7686915887850465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425140', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1138, 'n_words': 304}