Sha256: fcede5ddbbd494ce0f51a9e24c6444a810fa27eadfaaa31301fae0202291c990

Contents?: true

Size: 998 Bytes

Versions: 4

Compression:

Stored size: 998 Bytes

Contents

module HybridPlatformsConductor

  module HpcPlugins

    module Test

      # Test that the private IP address is correct
      class Ip < HybridPlatformsConductor::Test

        # Check my_test_plugin.rb.sample documentation for signature details.
        def test_on_node
          {
            'sudo hostname -I' => proc do |stdout|
              if stdout.first.nil?
                error 'No IP returned by "hostname -I"'
              else
                private_ips = @nodes_handler.get_private_ips_of @node
                if private_ips
                  host_ips = stdout.first.split(' ').select { |ip| ip =~ /^172\.16\.\d+\.\d+$/ }.sort
                  ref_ips = private_ips.sort
                  assert_equal(
                    host_ips,
                    ref_ips,
                    "Expected IPs to be #{ref_ips}, but got #{host_ips} instead"
                  )
                end
              end
            end
          }
        end

      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-32.4.2 lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb
hybrid_platforms_conductor-32.4.1 lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb
hybrid_platforms_conductor-32.4.0 lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb
hybrid_platforms_conductor-32.3.6 lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb