hybrid_platforms_conductor 32.17.0 → 33.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/README.md +6 -3
- data/bin/check-node +0 -1
- data/bin/deploy +0 -1
- data/bin/get_impacted_nodes +0 -1
- data/bin/last_deploys +12 -8
- data/bin/nodes_to_deploy +6 -6
- data/bin/setup +6 -6
- data/bin/topograph +1 -1
- data/docs/config_dsl.md +45 -1
- data/docs/executables.md +6 -7
- data/docs/executables/check-node.md +3 -3
- data/docs/executables/deploy.md +3 -3
- data/docs/executables/dump_nodes_json.md +3 -3
- data/docs/executables/test.md +3 -3
- data/docs/executables/topograph.md +3 -3
- data/docs/gen/mermaid/README.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/check-node.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/free_ips.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/get_impacted_nodes.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/last_deploys.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/nodes_to_deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/report.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/run.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/ssh_config.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/test.md-0.png +0 -0
- data/docs/plugins.md +46 -0
- data/docs/plugins/connector/ssh.md +1 -1
- data/docs/plugins/log/remote_fs.md +26 -0
- data/docs/plugins/secrets_reader/cli.md +31 -0
- data/docs/plugins/secrets_reader/thycotic.md +46 -0
- data/docs/plugins/test/check_deploy_and_idempotence.md +1 -1
- data/docs/plugins/test/connection.md +1 -0
- data/docs/plugins/test/deploy_removes_root_access.md +1 -1
- data/docs/plugins/test/file_system.md +1 -0
- data/docs/plugins/test/hostname.md +1 -0
- data/docs/plugins/test/ip.md +1 -0
- data/docs/plugins/test/local_users.md +1 -0
- data/docs/plugins/test/mounts.md +1 -0
- data/docs/plugins/test/orphan_files.md +1 -0
- data/docs/plugins/test/ports.md +1 -0
- data/docs/plugins/test/spectre.md +1 -0
- data/docs/plugins/test/vulnerabilities.md +1 -0
- data/lib/hybrid_platforms_conductor/action.rb +4 -4
- data/lib/hybrid_platforms_conductor/actions_executor.rb +45 -43
- data/lib/hybrid_platforms_conductor/bitbucket.rb +5 -4
- data/lib/hybrid_platforms_conductor/cmd_runner.rb +13 -12
- data/lib/hybrid_platforms_conductor/cmdb.rb +2 -2
- data/lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb +2 -1
- data/lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb +2 -1
- data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +5 -4
- data/lib/hybrid_platforms_conductor/common_config_dsl/github.rb +4 -3
- data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
- data/lib/hybrid_platforms_conductor/config.rb +8 -4
- data/lib/hybrid_platforms_conductor/confluence.rb +1 -1
- data/lib/hybrid_platforms_conductor/connector.rb +5 -2
- data/lib/hybrid_platforms_conductor/core_extensions/cleanroom/fix_kwargs.rb +116 -0
- data/lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb +24 -0
- data/lib/hybrid_platforms_conductor/credentials.rb +39 -36
- data/lib/hybrid_platforms_conductor/current_dir_monitor.rb +4 -1
- data/lib/hybrid_platforms_conductor/deployer.rb +275 -224
- data/lib/hybrid_platforms_conductor/executable.rb +20 -15
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/config.rb +10 -7
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_keys.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +4 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb +2 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +45 -49
- data/lib/hybrid_platforms_conductor/hpc_plugins/log/my_log_plugin.rb.sample +100 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb +180 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +68 -66
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/dsl_parser.rb +13 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/recipes_tree_builder.rb +39 -38
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/yaml_inventory.rb +5 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/docker.rb +43 -45
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/podman.rb +18 -20
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +118 -117
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +39 -43
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/reserve_proxmox_container +9 -13
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/confluence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +28 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb +26 -22
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb +77 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample +46 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +90 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +3 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb +4 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/connection.rb +3 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +7 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +21 -19
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +21 -22
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +19 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb +2 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/hostname.rb +3 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +4 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_conf.rb +21 -22
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_masters_ok.rb +10 -12
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +9 -9
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +5 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +5 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +13 -10
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +5 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +5 -5
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +5 -5
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +7 -7
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +3 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +27 -25
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/stdout.rb +8 -6
- data/lib/hybrid_platforms_conductor/io_router.rb +14 -13
- data/lib/hybrid_platforms_conductor/json_dumper.rb +2 -2
- data/lib/hybrid_platforms_conductor/log.rb +31 -0
- data/lib/hybrid_platforms_conductor/logger_helpers.rb +19 -16
- data/lib/hybrid_platforms_conductor/nodes_handler.rb +89 -71
- data/lib/hybrid_platforms_conductor/parallel_threads.rb +7 -11
- data/lib/hybrid_platforms_conductor/platform_handler.rb +7 -7
- data/lib/hybrid_platforms_conductor/platforms_handler.rb +5 -3
- data/lib/hybrid_platforms_conductor/plugin.rb +2 -2
- data/lib/hybrid_platforms_conductor/plugins.rb +14 -8
- data/lib/hybrid_platforms_conductor/provisioner.rb +4 -4
- data/lib/hybrid_platforms_conductor/report.rb +2 -2
- data/lib/hybrid_platforms_conductor/reports_handler.rb +3 -2
- data/lib/hybrid_platforms_conductor/secrets_reader.rb +31 -0
- data/lib/hybrid_platforms_conductor/services_handler.rb +32 -29
- data/lib/hybrid_platforms_conductor/test_only_remote_node.rb +18 -0
- data/lib/hybrid_platforms_conductor/test_report.rb +15 -18
- data/lib/hybrid_platforms_conductor/tests_runner.rb +116 -118
- data/lib/hybrid_platforms_conductor/thycotic.rb +28 -19
- data/lib/hybrid_platforms_conductor/topographer.rb +200 -190
- data/lib/hybrid_platforms_conductor/topographer/plugins/graphviz.rb +8 -8
- data/lib/hybrid_platforms_conductor/topographer/plugins/json.rb +4 -4
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test.rb +33 -12
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +18 -11
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +32 -21
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +75 -49
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +27 -15
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +90 -59
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +46 -44
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/connectable_nodes_spec.rb +12 -8
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/remote_actions_spec.rb +4 -7
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +21 -22
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb +23 -24
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connectable_nodes_spec.rb +10 -6
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +106 -75
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +145 -126
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/node_helpers_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +29 -25
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/logging_spec.rb +167 -142
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/parallel_spec.rb +272 -244
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +16 -16
- data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +36 -36
- data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +24 -22
- data/spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb +4 -2
- data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +43 -5
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +199 -216
- data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +223 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb +55 -59
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +36 -62
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/podman_spec.rb +17 -17
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/config_dsl_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/create_spec.rb +44 -51
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/ip_spec.rb +12 -16
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/destroy_vm_spec.rb +31 -19
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +324 -266
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/ips_assignment_spec.rb +89 -61
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/other_lxc_containers_resources_spec.rb +117 -93
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/pve_node_resources_spec.rb +71 -54
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +10 -8
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/vm_ids_assignment_spec.rb +80 -60
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb +64 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +268 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb +8 -10
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +33 -24
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb +64 -51
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/platform_handlers_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +50 -51
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/common_spec.rb +91 -81
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/config_dsl_spec.rb +14 -16
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/git_diff_impacts_spec.rb +51 -75
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/nodes_selectors_spec.rb +35 -26
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/platform_handlers_plugins_api_spec.rb +24 -16
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/several_platforms_spec.rb +29 -19
- data/spec/hybrid_platforms_conductor_test/api/platform_handler_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/config_dsl_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/deploy_output_parsing_spec.rb +6 -6
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/diff_impacts_spec.rb +57 -99
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +32 -35
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +10 -10
- data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +38 -27
- data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +46 -52
- data/spec/hybrid_platforms_conductor_test/api/reports_handler_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/services_handler/actions_to_deploy_spec.rb +90 -58
- data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +38 -34
- data/spec/hybrid_platforms_conductor_test/api/services_handler/log_info_spec.rb +11 -9
- data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +193 -171
- data/spec/hybrid_platforms_conductor_test/api/services_handler/parse_deploy_output_spec.rb +66 -54
- data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +147 -133
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +69 -49
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb +5 -4
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +8 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_spec.rb +8 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +30 -27
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb +12 -9
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +48 -47
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/github_ci_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +9 -9
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb2.rb → test_cmdb_2.rb} +6 -6
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb_others2.rb → test_cmdb_others_2.rb} +2 -2
- data/spec/hybrid_platforms_conductor_test/docs_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/{check-node_spec.rb → check_node_spec.rb} +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb +76 -77
- data/spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb +159 -113
- data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +299 -160
- data/spec/hybrid_platforms_conductor_test/executables/options/actions_executor_spec.rb +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +3 -5
- data/spec/hybrid_platforms_conductor_test/executables/options/common_spec.rb +8 -8
- data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +12 -196
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +9 -10
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_selectors_spec.rb +9 -10
- data/spec/hybrid_platforms_conductor_test/executables/options/reports_handler_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +22 -22
- data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +22 -16
- data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +32 -32
- data/spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb +7 -9
- data/spec/hybrid_platforms_conductor_test/executables/test_spec.rb +3 -5
- data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/cmd_runner_helpers.rb +4 -3
- data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +12 -13
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +245 -56
- data/spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb +11 -11
- data/spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +39 -28
- data/spec/hybrid_platforms_conductor_test/helpers/plugins_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +86 -111
- data/spec/hybrid_platforms_conductor_test/helpers/reports_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id1.rb → test_plugin_id_1.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id2.rb → test_plugin_id_2.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/{test_plugin_id3.rb → test_plugin_id_3.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/{test_plugin_type2/test_plugin_id4.rb → test_plugin_type_2/test_plugin_id_4.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/{test2.rb → test_2.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/rubocop_spec.rb +31 -0
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/nodes/node.json +3 -3
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/data_bags/nodes/node.json +3 -3
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/recipes/cookbooks/test_cookbook_2/libraries/default.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_cookbooks/other_cookbooks/test_cookbook_2/libraries/default.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb +952 -0
- data/spec/hybrid_platforms_conductor_test/test_connector.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/test_log_no_read_plugin.rb +84 -0
- data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +105 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/global.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/platform.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb +45 -0
- data/spec/hybrid_platforms_conductor_test/tests_report_plugin.rb +5 -6
- data/spec/spec_helper.rb +17 -18
- data/tools/check_md +16 -20
- data/tools/generate_mermaid +1 -1
- metadata +195 -144
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -916
data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require 'hybrid_platforms_conductor/secrets_reader'
|
|
2
|
+
|
|
3
|
+
module HybridPlatformsConductor
|
|
4
|
+
|
|
5
|
+
module HpcPlugins
|
|
6
|
+
|
|
7
|
+
module SecretsReader
|
|
8
|
+
|
|
9
|
+
# Read secrets from a secrets source
|
|
10
|
+
class MySecretsReaderPlugin < HybridPlatformsConductor::SecretsReader
|
|
11
|
+
|
|
12
|
+
# Complete an option parser with options meant to control this secrets reader
|
|
13
|
+
# [API] - This method is optional
|
|
14
|
+
#
|
|
15
|
+
# Parameters::
|
|
16
|
+
# * *options_parser* (OptionParser): The option parser to complete
|
|
17
|
+
def options_parse(options_parser)
|
|
18
|
+
@key_file = nil
|
|
19
|
+
options_parser.on('--key-file FILE', 'Key file decrypting a secret vault.') do |file|
|
|
20
|
+
@key_file = file
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Return secrets for a given service to be deployed on a node.
|
|
25
|
+
# [API] - This method is mandatory
|
|
26
|
+
# [API] - The following API components are accessible:
|
|
27
|
+
# * *@config* (Config): Main configuration API.
|
|
28
|
+
# * *@cmd_runner* (CmdRunner): Command Runner API.
|
|
29
|
+
# * *@nodes_handler* (NodesHandler): Nodes handler API.
|
|
30
|
+
#
|
|
31
|
+
# Parameters::
|
|
32
|
+
# * *node* (String): Node to be deployed
|
|
33
|
+
# * *service* (String): Service to be deployed
|
|
34
|
+
# Result::
|
|
35
|
+
# * Hash: The secrets
|
|
36
|
+
def secrets_for(node, service)
|
|
37
|
+
JSON.parse(Vault.decrypt("/path/to/#{node}_#{service}.vault", key: @key_file))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
require 'hybrid_platforms_conductor/secrets_reader'
|
|
2
|
+
require 'hybrid_platforms_conductor/thycotic'
|
|
3
|
+
|
|
4
|
+
module HybridPlatformsConductor
|
|
5
|
+
|
|
6
|
+
module HpcPlugins
|
|
7
|
+
|
|
8
|
+
module SecretsReader
|
|
9
|
+
|
|
10
|
+
# Get secrets from a Thycotic secrets server
|
|
11
|
+
class Thycotic < HybridPlatformsConductor::SecretsReader
|
|
12
|
+
|
|
13
|
+
# Extend the Config DSL
|
|
14
|
+
module ConfigDSLExtension
|
|
15
|
+
|
|
16
|
+
# List of defined Thycotic secrets. Each info has the following properties:
|
|
17
|
+
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by this rule.
|
|
18
|
+
# * *thycotic_url* (String): Thycotic URL.
|
|
19
|
+
# * *secret_id* (Integer): Thycotic secret ID.
|
|
20
|
+
# Array< Hash<Symbol, Object> >
|
|
21
|
+
attr_reader :thycotic_secrets
|
|
22
|
+
|
|
23
|
+
# Mixin initializer
|
|
24
|
+
def init_thycotic_config
|
|
25
|
+
@thycotic_secrets = []
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Set a Thycotic secret server configuration
|
|
29
|
+
#
|
|
30
|
+
# Parameters::
|
|
31
|
+
# * *thycotic_url* (String): The Thycotic server URL.
|
|
32
|
+
# * *secret_id* (Integer): The Thycotic secret ID containing the secrets file to be used as secrets.
|
|
33
|
+
def secrets_from_thycotic(thycotic_url:, secret_id:)
|
|
34
|
+
@thycotic_secrets << {
|
|
35
|
+
nodes_selectors_stack: current_nodes_selectors_stack,
|
|
36
|
+
thycotic_url: thycotic_url,
|
|
37
|
+
secret_id: secret_id
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Config.extend_config_dsl_with ConfigDSLExtension, :init_thycotic_config
|
|
44
|
+
|
|
45
|
+
# Return secrets for a given service to be deployed on a node.
|
|
46
|
+
# [API] - This method is mandatory
|
|
47
|
+
# [API] - The following API components are accessible:
|
|
48
|
+
# * *@config* (Config): Main configuration API.
|
|
49
|
+
# * *@cmd_runner* (CmdRunner): Command Runner API.
|
|
50
|
+
# * *@nodes_handler* (NodesHandler): Nodes handler API.
|
|
51
|
+
#
|
|
52
|
+
# Parameters::
|
|
53
|
+
# * *node* (String): Node to be deployed
|
|
54
|
+
# * *service* (String): Service to be deployed
|
|
55
|
+
# Result::
|
|
56
|
+
# * Hash: The secrets
|
|
57
|
+
def secrets_for(node, _service)
|
|
58
|
+
secrets = {}
|
|
59
|
+
# As we are dealing with global secrets, cache the reading for performance between nodes and services.
|
|
60
|
+
# Keep secrets cache grouped by URL/ID
|
|
61
|
+
@secrets = {} unless defined?(@secrets)
|
|
62
|
+
@nodes_handler.select_confs_for_node(node, @config.thycotic_secrets).each do |thycotic_secrets_info|
|
|
63
|
+
server_id = "#{thycotic_secrets_info[:thycotic_url]}:#{thycotic_secrets_info[:secret_id]}"
|
|
64
|
+
unless @secrets.key?(server_id)
|
|
65
|
+
HybridPlatformsConductor::Thycotic.with_thycotic(thycotic_secrets_info[:thycotic_url], @logger, @logger_stderr) do |thycotic|
|
|
66
|
+
secret_file_item_id = thycotic.get_secret(thycotic_secrets_info[:secret_id]).dig(:secret, :items, :secret_item, :id)
|
|
67
|
+
raise "Unable to fetch secret file ID #{thycotic_secrets_info[:secret_id]} from #{thycotic_secrets_info[:thycotic_url]}" if secret_file_item_id.nil?
|
|
68
|
+
|
|
69
|
+
secret = thycotic.download_file_attachment_by_item_id(thycotic_secrets_info[:secret_id], secret_file_item_id)
|
|
70
|
+
raise "Unable to fetch secret file attachment from secret ID #{thycotic_secrets_info[:secret_id]} from #{thycotic_secrets_info[:thycotic_url]}" if secret.nil?
|
|
71
|
+
|
|
72
|
+
@secrets[server_id] = JSON.parse(secret)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
secrets.merge!(@secrets[server_id]) do |key, value_1, value_2|
|
|
76
|
+
raise "Thycotic secret #{key} served by #{thycotic_secrets_info[:thycotic_url]} from secret ID #{thycotic_secrets_info[:secret_id]} has conflicting values between different secrets." if value_1 != value_2
|
|
77
|
+
|
|
78
|
+
value_1
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
secrets
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
end
|
|
@@ -10,7 +10,7 @@ module HybridPlatformsConductor
|
|
|
10
10
|
# Check that all repositories in Bitbucket have a consistent dev workflow.
|
|
11
11
|
class BitbucketConf < HybridPlatformsConductor::Test
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
extend_config_dsl_with CommonConfigDsl::Bitbucket, :init_bitbucket
|
|
14
14
|
|
|
15
15
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
16
16
|
def test
|
|
@@ -107,12 +107,12 @@ module HybridPlatformsConductor
|
|
|
107
107
|
mandatory_default_reviewers = repo_info.dig(*%i[checks pr_settings mandatory_default_reviewers])
|
|
108
108
|
if mandatory_default_reviewers
|
|
109
109
|
reviewers_found = default_reviewers.any? do |condition_info|
|
|
110
|
-
reviewers = condition_info
|
|
110
|
+
reviewers = condition_info['reviewers']
|
|
111
111
|
condition_info.dig('sourceRefMatcher', 'id') == 'ANY_REF_MATCHER_ID' &&
|
|
112
112
|
condition_info.dig('targetRefMatcher', 'id') == 'ANY_REF_MATCHER_ID' &&
|
|
113
113
|
!reviewers.nil? &&
|
|
114
114
|
(mandatory_default_reviewers - reviewers.map { |reviewer_info| reviewer_info['name'] }).empty? &&
|
|
115
|
-
(required_approvers.nil? || condition_info
|
|
115
|
+
(required_approvers.nil? || condition_info['requiredApprovals'] == required_approvers)
|
|
116
116
|
end
|
|
117
117
|
assert_equal(
|
|
118
118
|
reviewers_found,
|
|
@@ -18,7 +18,7 @@ module HybridPlatformsConductor
|
|
|
18
18
|
# Don't forget to add the testadmin private key in your SSH agent if you run this test locally.
|
|
19
19
|
class CheckDeployAndIdempotence < TestByService
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
extend_config_dsl_with CommonConfigDsl::IdempotenceTests, :init_idempotence_tests
|
|
22
22
|
|
|
23
23
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
24
24
|
def test_for_node
|
|
@@ -30,6 +30,7 @@ module HybridPlatformsConductor
|
|
|
30
30
|
ssh_ok = ssh.exec!('echo Works').strip == 'Works'
|
|
31
31
|
end
|
|
32
32
|
rescue
|
|
33
|
+
nil
|
|
33
34
|
end
|
|
34
35
|
assert_equal ssh_ok, true, 'Root does not have access from the empty image'
|
|
35
36
|
|
|
@@ -46,7 +47,7 @@ module HybridPlatformsConductor
|
|
|
46
47
|
deployer.nbr_retries_on_error = 3
|
|
47
48
|
exit_status, _stdout, _stderr = deployer.deploy_on(@node)[@node]
|
|
48
49
|
assert_equal exit_status, 0, "Deploy from scratch returned error code #{exit_status}", log_debug? ? nil : deployer.stdouts_to_s
|
|
49
|
-
if exit_status
|
|
50
|
+
if exit_status.zero?
|
|
50
51
|
# As it's possible sshd has to be restarted because of a change in its conf, restart the container.
|
|
51
52
|
# Otherwise you'll get the following error upon reconnection:
|
|
52
53
|
# System is booting up. See pam_nologin(8)
|
|
@@ -63,6 +64,7 @@ module HybridPlatformsConductor
|
|
|
63
64
|
ssh_ok = ssh.exec!('echo Works').strip == 'Works'
|
|
64
65
|
end
|
|
65
66
|
rescue
|
|
67
|
+
nil
|
|
66
68
|
end
|
|
67
69
|
assert_equal ssh_ok, false, 'Root can still connect on the image after deployment'
|
|
68
70
|
# Even if we can connect using root, run the idempotence test
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'hybrid_platforms_conductor/test_only_remote_node'
|
|
2
|
+
|
|
1
3
|
module HybridPlatformsConductor
|
|
2
4
|
|
|
3
5
|
module HpcPlugins
|
|
@@ -5,7 +7,7 @@ module HybridPlatformsConductor
|
|
|
5
7
|
module Test
|
|
6
8
|
|
|
7
9
|
# Test that the connection works by simply outputing something
|
|
8
|
-
class Connection <
|
|
10
|
+
class Connection < TestOnlyRemoteNode
|
|
9
11
|
|
|
10
12
|
TEST_CONNECTION_STRING = 'Test connection - ok'
|
|
11
13
|
|
|
@@ -12,27 +12,13 @@ module HybridPlatformsConductor
|
|
|
12
12
|
MAX_ACCEPTABLE_REFRESH_PERIOD_SECS = 3 * 31 * 24 * 60 * 60 # 3 months
|
|
13
13
|
|
|
14
14
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
15
|
-
def
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
error 'Node has never been deployed using deploy (/var/log/deployments does not exist)'
|
|
23
|
-
else
|
|
24
|
-
# Expecting following file names
|
|
25
|
-
# node-name_2017-12-01_093418_user-name
|
|
26
|
-
file_match = stdout.first.match(/^#{Regexp.escape(@node)}_(\d{4}-\d{2}-\d{2})_.+$/)
|
|
27
|
-
if file_match.nil?
|
|
28
|
-
error "Invalid chef deployment log file found: #{stdout.first}"
|
|
29
|
-
else
|
|
30
|
-
last_deploy_time = Time.parse(file_match[1])
|
|
31
|
-
error "Last deployment has been done on #{last_deploy_time.strftime('%F')}. Should refresh it." if now - last_deploy_time > MAX_ACCEPTABLE_REFRESH_PERIOD_SECS
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
}
|
|
15
|
+
def test_for_node
|
|
16
|
+
deploy_info = @deployer.deployment_info_from(@node)[@node]
|
|
17
|
+
if deploy_info.key?(:error)
|
|
18
|
+
error "Error while getting deployment info: #{deploy_info[:error]}"
|
|
19
|
+
elsif Time.now.utc - deploy_info[:deployment_info][:date] > MAX_ACCEPTABLE_REFRESH_PERIOD_SECS
|
|
20
|
+
error "Last deployment has been done on #{deploy_info[:deployment_info][:date].strftime('%F')}. Should refresh it."
|
|
21
|
+
end
|
|
36
22
|
end
|
|
37
23
|
|
|
38
24
|
end
|
|
@@ -12,32 +12,34 @@ module HybridPlatformsConductor
|
|
|
12
12
|
|
|
13
13
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
14
14
|
def test_for_node
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
return if @nodes_handler.get_root_access_allowed_of(@node)
|
|
16
|
+
|
|
17
|
+
@deployer.with_test_provisioned_instance(@config.tests_provisioner_id, @node, environment: 'deploy_removes_root_access', reuse_instance: log_debug?) do |deployer, instance|
|
|
18
|
+
# Check that we can connect with root
|
|
19
|
+
ssh_ok = false
|
|
20
|
+
begin
|
|
21
|
+
Net::SSH.start(instance.ip, 'root', password: 'root_pwd', auth_methods: ['password'], verify_host_key: :never) do |ssh|
|
|
22
|
+
ssh_ok = ssh.exec!('echo Works').strip == 'Works'
|
|
23
|
+
end
|
|
24
|
+
rescue
|
|
25
|
+
nil
|
|
26
|
+
end
|
|
27
|
+
assert_equal ssh_ok, true, 'Root does not have access from the empty image'
|
|
28
|
+
if ssh_ok
|
|
29
|
+
deployer.nbr_retries_on_error = 3
|
|
30
|
+
deployer.deploy_on @node
|
|
31
|
+
# As sshd is certainly being restarted, start and stop the container to reload it.
|
|
32
|
+
deployer.restart @node
|
|
33
|
+
# Check that we can't connect with root
|
|
18
34
|
ssh_ok = false
|
|
19
35
|
begin
|
|
20
36
|
Net::SSH.start(instance.ip, 'root', password: 'root_pwd', auth_methods: ['password'], verify_host_key: :never) do |ssh|
|
|
21
37
|
ssh_ok = ssh.exec!('echo Works').strip == 'Works'
|
|
22
38
|
end
|
|
23
39
|
rescue
|
|
40
|
+
nil
|
|
24
41
|
end
|
|
25
|
-
assert_equal ssh_ok,
|
|
26
|
-
if ssh_ok
|
|
27
|
-
deployer.nbr_retries_on_error = 3
|
|
28
|
-
deployer.deploy_on @node
|
|
29
|
-
# As sshd is certainly being restarted, start and stop the container to reload it.
|
|
30
|
-
deployer.restart @node
|
|
31
|
-
# Check that we can't connect with root
|
|
32
|
-
ssh_ok = false
|
|
33
|
-
begin
|
|
34
|
-
Net::SSH.start(instance.ip, 'root', password: 'root_pwd', auth_methods: ['password'], verify_host_key: :never) do |ssh|
|
|
35
|
-
ssh_ok = ssh.exec!('echo Works').strip == 'Works'
|
|
36
|
-
end
|
|
37
|
-
rescue
|
|
38
|
-
end
|
|
39
|
-
assert_equal ssh_ok, false, 'Root can still connect on the image after deployment'
|
|
40
|
-
end
|
|
42
|
+
assert_equal ssh_ok, false, 'Root can still connect on the image after deployment'
|
|
41
43
|
end
|
|
42
44
|
end
|
|
43
45
|
end
|
|
@@ -10,10 +10,10 @@ module HybridPlatformsConductor
|
|
|
10
10
|
# Test that the node has not diverged since last deployment
|
|
11
11
|
class Divergence < HybridPlatformsConductor::Test
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
extend_config_dsl_with CommonConfigDsl::IdempotenceTests, :init_idempotence_tests
|
|
14
14
|
|
|
15
15
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
16
|
-
def test_on_check_node(stdout, stderr,
|
|
16
|
+
def test_on_check_node(stdout, stderr, _exit_status)
|
|
17
17
|
# Check that the output of the check-node returns no changes.
|
|
18
18
|
ignored_tasks = @nodes_handler.select_confs_for_node(@node, @config.ignored_divergent_tasks).inject({}) do |merged_ignored_tasks, conf|
|
|
19
19
|
merged_ignored_tasks.merge(conf[:ignored_tasks])
|
|
@@ -27,7 +27,7 @@ module HybridPlatformsConductor
|
|
|
27
27
|
).known_platforms.first
|
|
28
28
|
unless example_platform.nil?
|
|
29
29
|
tests.concat [
|
|
30
|
-
"#{CmdRunner.executables_prefix}get_impacted_nodes --platform #{example_platform.name} --show-commands"
|
|
30
|
+
"#{CmdRunner.executables_prefix}get_impacted_nodes --platform #{example_platform.name} --show-commands"
|
|
31
31
|
]
|
|
32
32
|
example_node = example_platform.known_nodes.first
|
|
33
33
|
unless example_node.nil?
|
|
@@ -42,7 +42,7 @@ module HybridPlatformsConductor
|
|
|
42
42
|
]
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
|
-
|
|
45
|
+
tests.sort.each do |cmd|
|
|
46
46
|
log_debug "Testing #{cmd}"
|
|
47
47
|
exit_status, stdout, _stderr = @cmd_runner.run_cmd "#{cmd} 2>&1", no_exception: true, log_to_stdout: log_debug?
|
|
48
48
|
assert_equal(exit_status, 0, "Command #{cmd} returned code #{exit_status}:\n#{stdout}")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'hybrid_platforms_conductor/test_only_remote_node'
|
|
1
2
|
require 'hybrid_platforms_conductor/common_config_dsl/file_system_tests'
|
|
2
3
|
|
|
3
4
|
module HybridPlatformsConductor
|
|
@@ -7,33 +8,31 @@ module HybridPlatformsConductor
|
|
|
7
8
|
module Test
|
|
8
9
|
|
|
9
10
|
# Perform various tests on a node's file system
|
|
10
|
-
class FileSystem <
|
|
11
|
+
class FileSystem < TestOnlyRemoteNode
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
extend_config_dsl_with CommonConfigDsl::FileSystemTests, :init_file_system_tests
|
|
13
14
|
|
|
14
15
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
15
16
|
def test_on_node
|
|
16
17
|
# Flatten the paths rules so that we can spot inconsistencies in configuration
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
]
|
|
18
|
+
@config.aggregate_files_rules(@nodes_handler, @node).map do |path, rule_info|
|
|
19
|
+
[
|
|
20
|
+
"if #{@nodes_handler.sudo_on(@node)} /bin/bash -c '[[ -d \"#{path}\" ]]' ; then echo 1 ; else echo 0 ; fi",
|
|
21
|
+
{
|
|
22
|
+
validator: proc do |stdout, stderr|
|
|
23
|
+
case stdout.last
|
|
24
|
+
when '1'
|
|
25
|
+
error "Path found that should be absent: #{path}" if rule_info[:state] == :absent
|
|
26
|
+
when '0'
|
|
27
|
+
error "Path not found that should be present: #{path}" if rule_info[:state] == :present
|
|
28
|
+
else
|
|
29
|
+
error "Could not check for existence of path #{path}", "----- STDOUT:\n#{stdout.join("\n")}----- STDERR:\n#{stderr.join("\n")}"
|
|
30
|
+
end
|
|
31
|
+
end,
|
|
32
|
+
timeout: 2
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
end.to_h
|
|
37
36
|
end
|
|
38
37
|
|
|
39
38
|
end
|
|
@@ -9,31 +9,29 @@ module HybridPlatformsConductor
|
|
|
9
9
|
# Perform various tests on a HDFS's file system
|
|
10
10
|
class FileSystemHdfs < HybridPlatformsConductor::Test
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
extend_config_dsl_with CommonConfigDsl::FileSystemTests, :init_file_system_tests
|
|
13
13
|
|
|
14
14
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
15
15
|
def test_on_node
|
|
16
16
|
# Flatten the paths rules so that we can spot inconsistencies in configuration
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
]
|
|
17
|
+
@config.aggregate_files_rules(@nodes_handler, @node, file_system_type: :hdfs).map do |path, rule_info|
|
|
18
|
+
[
|
|
19
|
+
"if sudo#{rule_info[:context][:sudo_user] ? " -u #{rule_info[:context][:sudo_user]}" : ''} hdfs dfs -ls \"#{path}\" ; then echo 1 ; else echo 0 ; fi",
|
|
20
|
+
{
|
|
21
|
+
validator: proc do |stdout, stderr|
|
|
22
|
+
case stdout.last
|
|
23
|
+
when '1'
|
|
24
|
+
error "HDFS path found that should be absent: #{path}" if rule_info[:state] == :absent
|
|
25
|
+
when '0'
|
|
26
|
+
error "HDFS path not found that should be present: #{path}" if rule_info[:state] == :present
|
|
27
|
+
else
|
|
28
|
+
error "Could not check for existence of HDFS path #{path}", "----- STDOUT:\n#{stdout.join("\n")}----- STDERR:\n#{stderr.join("\n")}"
|
|
29
|
+
end
|
|
30
|
+
end,
|
|
31
|
+
timeout: 5
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
end.to_h
|
|
37
35
|
end
|
|
38
36
|
|
|
39
37
|
end
|
|
@@ -9,7 +9,7 @@ module HybridPlatformsConductor
|
|
|
9
9
|
# Check that all repositories have a successful Github CI
|
|
10
10
|
class GithubCi < HybridPlatformsConductor::Test
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
extend_config_dsl_with CommonConfigDsl::Github, :init_github
|
|
13
13
|
|
|
14
14
|
# Check my_test_plugin.rb.sample documentation for signature details.
|
|
15
15
|
def test
|
|
@@ -17,8 +17,7 @@ module HybridPlatformsConductor
|
|
|
17
17
|
log_debug "Checking CI for Github repository #{repo_info[:slug]}"
|
|
18
18
|
last_status = client.repository_workflow_runs(repo_info[:slug])[:workflow_runs].
|
|
19
19
|
select { |run| run[:head_branch] == 'master' }.
|
|
20
|
-
|
|
21
|
-
last[:conclusion]
|
|
20
|
+
max_by { |run| run[:created_at] }[:conclusion]
|
|
22
21
|
error "Last workflow status for repository #{repo_info[:slug]} is #{last_status}" unless last_status == 'success'
|
|
23
22
|
end
|
|
24
23
|
end
|