Class: HybridPlatformsConductor::HpcPlugins::Test::Veids

Inherits:
Test
  • Object
show all
Defined in:
lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb

Overview

Test that VEIDs are assigned correctly

Constant Summary

Constants included from LoggerHelpers

LoggerHelpers::LEVELS_MODIFIERS, LoggerHelpers::LEVELS_TO_STDERR

Instance Attribute Summary

Attributes inherited from Test

#errors, #expected_failure, #name, #node, #platform

Instance Method Summary collapse

Methods inherited from Test

#assert_equal, #assert_match, #error, #executed, #executed?, #initialize, only_on_nodes, only_on_platforms, #to_s

Methods inherited from Plugin

extend_config_dsl_with, #initialize, valid?

Methods included from LoggerHelpers

#err, #init_loggers, #log_component=, #log_debug?, #log_level=, #out, #section, #set_loggers_format, #stderr_device, #stderr_device=, #stderr_displayed?, #stdout_device, #stdout_device=, #stdout_displayed?, #stdouts_to_s, #with_progress_bar

Constructor Details

This class inherits a constructor from HybridPlatformsConductor::Test

Instance Method Details

#testObject

Check my_test_plugin.rb.sample documentation for signature details.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb', line 11

def test
  # Get a map of VEIDs per node
  @nodes_handler. @nodes_handler.known_nodes, :veid
  veids = Hash[@nodes_handler.
    known_nodes.
    map { |node| [node, @nodes_handler.get_veid_of(node) ? @nodes_handler.get_veid_of(node).to_i : nil] }
  ]

  # Check there are no duplicates
  veids.group_by { |_node, veid| veid }.each do |veid, nodes|
    error "VEID #{veid} is used by the following nodes: #{nodes.map { |node, _veid| node }.join(', ')}" if !veid.nil? && nodes.size > 1
  end
end