Sha256: 0a6a0f46f7c0518e0c52606ceaac9f5d286f39b8f839ca91191b5aa37bd4e1ec
Contents?: true
Size: 1.46 KB
Versions: 4
Compression:
Stored size: 1.46 KB
Contents
require 'hybrid_platforms_conductor/common_config_dsl/file_system_tests' module HybridPlatformsConductor module HpcPlugins module Test # Perform various tests on a node's file system class FileSystem < HybridPlatformsConductor::Test self.extend_config_dsl_with CommonConfigDsl::FileSystemTests, :init_file_system_tests # Check my_test_plugin.rb.sample documentation for signature details. 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 sudo /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 end end end end
Version data entries
4 entries across 4 versions & 1 rubygems