Class: HybridPlatformsConductor::HpcPlugins::Test::FileSystem
- Inherits:
-
TestOnlyRemoteNode
- Object
- Plugin
- Test
- TestOnlyRemoteNode
- HybridPlatformsConductor::HpcPlugins::Test::FileSystem
- Defined in:
- lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb
Overview
Perform various tests on a node’s file system
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
-
#test_on_node ⇒ Object
Check my_test_plugin.rb.sample documentation for signature details.
Methods inherited from TestOnlyRemoteNode
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
#test_on_node ⇒ Object
Check my_test_plugin.rb.sample documentation for signature details.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb', line 16 def test_on_node # Flatten the paths rules so that we can spot inconsistencies in configuration Hash[ @config.aggregate_files_rules(@nodes_handler, @node).map do |path, rule_info| [ "if #{@nodes_handler.sudo_on(@node)} /bin/bash -c '[[ -d \"#{path}\" ]]' ; then echo 1 ; else echo 0 ; fi", { validator: proc do |stdout, stderr| case stdout.last when '1' error "Path found that should be absent: #{path}" if rule_info[:state] == :absent when '0' error "Path not found that should be present: #{path}" if rule_info[:state] == :present else error "Could not check for existence of path #{path}", "----- STDOUT:\n#{stdout.join("\n")}----- STDERR:\n#{stderr.join("\n")}" end end, timeout: 2 } ] end ] end |