hybrid_platforms_conductor 32.16.4 → 33.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -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 +47 -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/bitbucket_conf.md +1 -1
- 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/github_ci.md +48 -0
- data/docs/plugins/test/hostname.md +1 -0
- data/docs/plugins/test/ip.md +1 -0
- data/docs/plugins/test/jenkins_ci_conf.md +1 -1
- data/docs/plugins/test/jenkins_ci_masters_ok.md +1 -1
- 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 +63 -0
- data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
- data/lib/hybrid_platforms_conductor/config.rb +7 -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/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 +31 -0
- 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 +16 -11
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +23 -18
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +67 -49
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +20 -14
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +63 -50
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +35 -35
- 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 +73 -54
- 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 +106 -91
- 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 +10 -12
- 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 +72 -0
- 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 +82 -13
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -916
@@ -2,9 +2,9 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking the reserve_proxmox_container sync tool' do
|
5
|
+
context 'when checking the reserve_proxmox_container sync tool' do
|
6
6
|
|
7
|
-
context 'checking resources limits at the PVE node level' do
|
7
|
+
context 'when checking resources limits at the PVE node level' do
|
8
8
|
|
9
9
|
it 'reserves a resource on an empty PVE node having enough resources' do
|
10
10
|
with_sync_node do
|
@@ -86,12 +86,14 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
86
86
|
|
87
87
|
it 'chooses among several PVE nodes the one having enough resources' do
|
88
88
|
with_sync_node do
|
89
|
-
mock_proxmox(
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
mock_proxmox(
|
90
|
+
mocked_pve_nodes: {
|
91
|
+
'pve_node_1' => { loadavg: [0.1, 11, 0.1] },
|
92
|
+
'pve_node_2' => { memory_total: 1126 * 1024 * 1024 },
|
93
|
+
'pve_node_3' => {},
|
94
|
+
'pve_node_4' => { storage_total: 512 * 1024 * 1024 }
|
95
|
+
}
|
96
|
+
)
|
95
97
|
expect(call_reserve_proxmox_container(2, 1024, 4, config: { pve_nodes: %w[pve_node_1 pve_node_2 pve_node_3 pve_node_4] })).to eq(
|
96
98
|
pve_node: 'pve_node_3',
|
97
99
|
vm_id: 1000,
|
@@ -102,12 +104,14 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
102
104
|
|
103
105
|
it 'chooses among several PVE nodes by discovering them instead of limiting them in the config' do
|
104
106
|
with_sync_node do
|
105
|
-
mock_proxmox(
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
107
|
+
mock_proxmox(
|
108
|
+
mocked_pve_nodes: {
|
109
|
+
'pve_node_1' => { loadavg: [0.1, 11, 0.1] },
|
110
|
+
'pve_node_2' => { memory_total: 1126 * 1024 * 1024 },
|
111
|
+
'pve_node_3' => {},
|
112
|
+
'pve_node_4' => { storage_total: 512 * 1024 * 1024 }
|
113
|
+
}
|
114
|
+
)
|
111
115
|
expect(call_reserve_proxmox_container(2, 1024, 4, config: { pve_nodes: nil })).to eq(
|
112
116
|
pve_node: 'pve_node_3',
|
113
117
|
vm_id: 1000,
|
@@ -118,13 +122,15 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
118
122
|
|
119
123
|
it 'chooses among several PVE nodes the one having the most free resources' do
|
120
124
|
with_sync_node do
|
121
|
-
mock_proxmox(
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
mock_proxmox(
|
126
|
+
mocked_pve_nodes: {
|
127
|
+
'pve_node_1gb' => { memory_total: 1 * 1024 * 1024 * 1024 },
|
128
|
+
'pve_node_4.5gb' => { memory_total: 4608 * 1024 * 1024 },
|
129
|
+
'pve_node_5gb' => { memory_total: 5 * 1024 * 1024 * 1024 },
|
130
|
+
'pve_node_10gb' => { memory_total: 10 * 1024 * 1024 * 1024 },
|
131
|
+
'pve_node_7gb' => { memory_total: 7 * 1024 * 1024 * 1024 }
|
132
|
+
}
|
133
|
+
)
|
128
134
|
expect(call_reserve_proxmox_container(2, 4096, 4, config: { pve_nodes: %w[pve_node_1gb pve_node_4.5gb pve_node_5gb pve_node_10gb pve_node_7gb] })).to eq(
|
129
135
|
pve_node: 'pve_node_10gb',
|
130
136
|
vm_id: 1000,
|
@@ -135,13 +141,15 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
135
141
|
|
136
142
|
it 'chooses among several PVE nodes the one having the most free resources and that are part of the authorized PVE nodes' do
|
137
143
|
with_sync_node do
|
138
|
-
mock_proxmox(
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
144
|
+
mock_proxmox(
|
145
|
+
mocked_pve_nodes: {
|
146
|
+
'pve_node_1gb' => { memory_total: 1 * 1024 * 1024 * 1024 },
|
147
|
+
'pve_node_4.5gb' => { memory_total: 4608 * 1024 * 1024 },
|
148
|
+
'pve_node_5gb' => { memory_total: 5 * 1024 * 1024 * 1024 },
|
149
|
+
'pve_node_10gb' => { memory_total: 10 * 1024 * 1024 * 1024 },
|
150
|
+
'pve_node_7gb' => { memory_total: 7 * 1024 * 1024 * 1024 }
|
151
|
+
}
|
152
|
+
)
|
145
153
|
expect(call_reserve_proxmox_container(2, 4096, 4, config: { pve_nodes: %w[pve_node_1gb pve_node_5gb pve_node_7gb] })).to eq(
|
146
154
|
pve_node: 'pve_node_7gb',
|
147
155
|
vm_id: 1000,
|
@@ -152,13 +160,15 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
152
160
|
|
153
161
|
it 'does not reserve a resource if the only PVE nodes having resources are not in the list of authorized PVE nodes' do
|
154
162
|
with_sync_node do
|
155
|
-
mock_proxmox(
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
163
|
+
mock_proxmox(
|
164
|
+
mocked_pve_nodes: {
|
165
|
+
'pve_node_1gb' => { memory_total: 1 * 1024 * 1024 * 1024 },
|
166
|
+
'pve_node_4.5gb' => { memory_total: 4608 * 1024 * 1024 },
|
167
|
+
'pve_node_5gb' => { memory_total: 5 * 1024 * 1024 * 1024 },
|
168
|
+
'pve_node_10gb' => { memory_total: 10 * 1024 * 1024 * 1024 },
|
169
|
+
'pve_node_7gb' => { memory_total: 7 * 1024 * 1024 * 1024 }
|
170
|
+
}
|
171
|
+
)
|
162
172
|
expect(call_reserve_proxmox_container(2, 4096, 4, config: { pve_nodes: %w[pve_node_1gb pve_node_4.5gb] })).to eq(error: 'not_enough_resources')
|
163
173
|
end
|
164
174
|
end
|
@@ -167,25 +177,32 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
167
177
|
with_sync_node do
|
168
178
|
# We ask to reserve 1GB of RAM and 1GB of disk.
|
169
179
|
# Commented are the % of those resources' usage when having such a container in each PVE node, with the resulting score considering RAM 3 times as important than disk.
|
170
|
-
mock_proxmox(
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
180
|
+
mock_proxmox(
|
181
|
+
mocked_pve_nodes: {
|
182
|
+
# 100% RAM 25% disk => 325
|
183
|
+
'pve_node_1gb_4gb' => { memory_total: 1 * 1024 * 1024 * 1024, storage_total: 4 * 1024 * 1024 * 1024 },
|
184
|
+
# 50% RAM 25% disk => 175
|
185
|
+
'pve_node_2gb_4gb' => { memory_total: 2 * 1024 * 1024 * 1024, storage_total: 4 * 1024 * 1024 * 1024 },
|
186
|
+
# 50% RAM 50% disk => 200
|
187
|
+
'pve_node_2gb_2gb' => { memory_total: 2 * 1024 * 1024 * 1024, storage_total: 2 * 1024 * 1024 * 1024 },
|
188
|
+
# 40% RAM 10% disk => 130
|
189
|
+
'pve_node_2.5gb_10gb' => { memory_total: 2560 * 1024 * 1024, storage_total: 10 * 1024 * 1024 * 1024 },
|
190
|
+
# 25% RAM 50% disk => 125
|
191
|
+
'pve_node_4gb_2gb' => { memory_total: 4 * 1024 * 1024 * 1024, storage_total: 2 * 1024 * 1024 * 1024 },
|
192
|
+
# 25% RAM 100% disk => 175
|
193
|
+
'pve_node_4gb_1gb' => { memory_total: 4 * 1024 * 1024 * 1024, storage_total: 1 * 1024 * 1024 * 1024 }
|
194
|
+
}
|
195
|
+
)
|
196
|
+
expect(
|
197
|
+
call_reserve_proxmox_container(
|
198
|
+
2, 1024, 1,
|
199
|
+
config: {
|
200
|
+
coeff_ram_consumption: 3,
|
201
|
+
coeff_disk_consumption: 1,
|
202
|
+
pve_nodes: nil
|
203
|
+
}
|
204
|
+
)
|
205
|
+
).to eq(
|
189
206
|
pve_node: 'pve_node_4gb_2gb',
|
190
207
|
vm_id: 1000,
|
191
208
|
vm_ip: '192.168.0.100'
|
@@ -2,9 +2,9 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking the reserve_proxmox_container sync tool' do
|
5
|
+
context 'when checking the reserve_proxmox_container sync tool' do
|
6
6
|
|
7
|
-
context 'checking retries mechanism' do
|
7
|
+
context 'when checking retries mechanism' do
|
8
8
|
|
9
9
|
it 'retries a few times before ending in error' do
|
10
10
|
with_sync_node do
|
@@ -16,11 +16,13 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
16
16
|
|
17
17
|
it 'retries errors a few times until it gets resolved' do
|
18
18
|
with_sync_node do
|
19
|
-
mock_proxmox(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
mock_proxmox(
|
20
|
+
mocked_pve_nodes: [
|
21
|
+
{ 'pve_node_name' => { loadavg: [0.1, 11, 0.1] } },
|
22
|
+
{ 'pve_node_name' => { loadavg: [0.1, 11, 0.1] } },
|
23
|
+
{ 'pve_node_name' => { loadavg: [0.1, 9, 0.1] } }
|
24
|
+
]
|
25
|
+
)
|
24
26
|
expect(call_reserve_proxmox_container(2, 1024, 4, max_retries: 5)).to eq(
|
25
27
|
pve_node: 'pve_node_name',
|
26
28
|
vm_id: 1000,
|
@@ -51,7 +53,7 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
51
53
|
mock_proxmox(mocked_pve_nodes: [{ 'pve_node_name' => { error_strings: ['NOK: error code = 500'] * 5 } }])
|
52
54
|
result = call_reserve_proxmox_container(2, 1024, 4, config: { api_max_retries: 4 })
|
53
55
|
expect(result[:error]).not_to eq nil
|
54
|
-
expect(result[:error]).to match
|
56
|
+
expect(result[:error]).to match(%r{Unhandled exception from reserve_proxmox_container: Proxmox API get nodes/pve_node_name/lxc returns NOK: error code = 500 continuously \(tried 5 times\)})
|
55
57
|
expect_proxmox_actions_to_be [
|
56
58
|
[:create_ticket],
|
57
59
|
[:create_ticket],
|
@@ -2,20 +2,22 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking the reserve_proxmox_container sync tool' do
|
5
|
+
context 'when checking the reserve_proxmox_container sync tool' do
|
6
6
|
|
7
|
-
context 'checking how VM IDs are being assigned to containers' do
|
7
|
+
context 'when checking how VM IDs are being assigned to containers' do
|
8
8
|
|
9
9
|
it 'makes sure to not use a VM ID already assigned to another container' do
|
10
10
|
with_sync_node do
|
11
|
-
mock_proxmox(
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
mock_proxmox(
|
12
|
+
mocked_pve_nodes: {
|
13
|
+
'pve_node_name' => {
|
14
|
+
lxc_containers: {
|
15
|
+
1000 => { ip: '192.168.1.100' },
|
16
|
+
1001 => { ip: '192.168.1.101' }
|
17
|
+
}
|
16
18
|
}
|
17
19
|
}
|
18
|
-
|
20
|
+
)
|
19
21
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
20
22
|
pve_node: 'pve_node_name',
|
21
23
|
vm_id: 1002,
|
@@ -26,15 +28,17 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
26
28
|
|
27
29
|
it 'makes sure to not use a VM ID already assigned to another container even on another PVE node' do
|
28
30
|
with_sync_node do
|
29
|
-
mock_proxmox(
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
mock_proxmox(
|
32
|
+
mocked_pve_nodes: {
|
33
|
+
'pve_node_name' => {},
|
34
|
+
'pve_other_node_name' => {
|
35
|
+
lxc_containers: {
|
36
|
+
1000 => { ip: '192.168.1.100' },
|
37
|
+
1001 => { ip: '192.168.1.101' }
|
38
|
+
}
|
35
39
|
}
|
36
40
|
}
|
37
|
-
|
41
|
+
)
|
38
42
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
39
43
|
pve_node: 'pve_node_name',
|
40
44
|
vm_id: 1002,
|
@@ -45,33 +49,39 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
45
49
|
|
46
50
|
it 'does not reserve when no VM ID is available' do
|
47
51
|
with_sync_node do
|
48
|
-
mock_proxmox(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
mock_proxmox(
|
53
|
+
mocked_pve_nodes: {
|
54
|
+
'pve_node_name' => {},
|
55
|
+
'pve_other_node_name' => {
|
56
|
+
lxc_containers: {
|
57
|
+
1000 => { ip: '192.168.1.100' },
|
58
|
+
1001 => { ip: '192.168.1.101' },
|
59
|
+
1002 => { ip: '192.168.1.102' },
|
60
|
+
1003 => { ip: '192.168.1.103' }
|
61
|
+
}
|
56
62
|
}
|
57
63
|
}
|
58
|
-
|
64
|
+
)
|
59
65
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1002] })).to eq(error: 'no_available_vm_id')
|
60
66
|
end
|
61
67
|
end
|
62
68
|
|
63
69
|
it 'makes sure to remove cgroup files that are leftovers of removed containers' do
|
64
|
-
with_sync_node(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
with_sync_node(
|
71
|
+
leftovers: [
|
72
|
+
'/sys/fs/cgroup/memory/lxc/1003'
|
73
|
+
]
|
74
|
+
) do
|
75
|
+
mock_proxmox(
|
76
|
+
mocked_pve_nodes: {
|
77
|
+
'pve_node_name' => {
|
78
|
+
lxc_containers: {
|
79
|
+
1000 => { ip: '192.168.1.100' },
|
80
|
+
1001 => { ip: '192.168.1.101' }
|
81
|
+
}
|
72
82
|
}
|
73
83
|
}
|
74
|
-
|
84
|
+
)
|
75
85
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
76
86
|
pve_node: 'pve_node_name',
|
77
87
|
vm_id: 1002,
|
@@ -81,17 +91,21 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
81
91
|
end
|
82
92
|
|
83
93
|
it 'makes sure to remove cgroup files that are leftovers of removed containers even when they are reusing the VM ID' do
|
84
|
-
with_sync_node(
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
94
|
+
with_sync_node(
|
95
|
+
leftovers: [
|
96
|
+
'/sys/fs/cgroup/memory/lxc/1002'
|
97
|
+
]
|
98
|
+
) do
|
99
|
+
mock_proxmox(
|
100
|
+
mocked_pve_nodes: {
|
101
|
+
'pve_node_name' => {
|
102
|
+
lxc_containers: {
|
103
|
+
1000 => { ip: '192.168.1.100' },
|
104
|
+
1001 => { ip: '192.168.1.101' }
|
105
|
+
}
|
92
106
|
}
|
93
107
|
}
|
94
|
-
|
108
|
+
)
|
95
109
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
96
110
|
pve_node: 'pve_node_name',
|
97
111
|
vm_id: 1002,
|
@@ -101,19 +115,23 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
101
115
|
end
|
102
116
|
|
103
117
|
it 'makes sure to remove cgroup files that are leftovers of removed containers when several cgroups contain files' do
|
104
|
-
with_sync_node(
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
118
|
+
with_sync_node(
|
119
|
+
leftovers: [
|
120
|
+
'/sys/fs/cgroup/memory/lxc/1003',
|
121
|
+
'/sys/fs/cgroup/network/lxc/1003',
|
122
|
+
'/sys/fs/cgroup/cpu/lxc/1003'
|
123
|
+
]
|
124
|
+
) do
|
125
|
+
mock_proxmox(
|
126
|
+
mocked_pve_nodes: {
|
127
|
+
'pve_node_name' => {
|
128
|
+
lxc_containers: {
|
129
|
+
1000 => { ip: '192.168.1.100' },
|
130
|
+
1001 => { ip: '192.168.1.101' }
|
131
|
+
}
|
114
132
|
}
|
115
133
|
}
|
116
|
-
|
134
|
+
)
|
117
135
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
118
136
|
pve_node: 'pve_node_name',
|
119
137
|
vm_id: 1002,
|
@@ -135,15 +153,17 @@ describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
|
135
153
|
'/sys/fs/cgroup/memory/lxc/1001'
|
136
154
|
]
|
137
155
|
) do
|
138
|
-
mock_proxmox(
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
156
|
+
mock_proxmox(
|
157
|
+
mocked_pve_nodes: {
|
158
|
+
'pve_node_name' => {
|
159
|
+
lxc_containers: {
|
160
|
+
100 => { ip: '192.168.1.10' },
|
161
|
+
1000 => { ip: '192.168.1.100' },
|
162
|
+
1001 => { ip: '192.168.1.101' }
|
163
|
+
}
|
144
164
|
}
|
145
165
|
}
|
146
|
-
|
166
|
+
)
|
147
167
|
expect(call_reserve_proxmox_container(2, 1024, 1, config: { vm_ids_range: [1000, 1100] })).to eq(
|
148
168
|
pve_node: 'pve_node_name',
|
149
169
|
vm_id: 1002,
|
@@ -2,7 +2,7 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking containers start' do
|
5
|
+
context 'when checking containers start' do
|
6
6
|
|
7
7
|
it 'starts an instance' do
|
8
8
|
with_test_proxmox_platform do |instance|
|
@@ -2,7 +2,7 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking containers state' do
|
5
|
+
context 'when checking containers state' do
|
6
6
|
|
7
7
|
it 'gets the status of a missing instance' do
|
8
8
|
with_test_proxmox_platform do |instance|
|
@@ -2,7 +2,7 @@ require 'hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox'
|
|
2
2
|
|
3
3
|
describe HybridPlatformsConductor::HpcPlugins::Provisioner::Proxmox do
|
4
4
|
|
5
|
-
context 'checking containers stop' do
|
5
|
+
context 'when checking containers stop' do
|
6
6
|
|
7
7
|
it 'stops an instance' do
|
8
8
|
with_test_proxmox_platform do |instance|
|
@@ -0,0 +1,64 @@
|
|
1
|
+
describe HybridPlatformsConductor::Deployer do
|
2
|
+
|
3
|
+
context 'when checking secrets_reader plugins' do
|
4
|
+
|
5
|
+
context 'with cli' do
|
6
|
+
|
7
|
+
# Setup a platform for tests
|
8
|
+
#
|
9
|
+
# Parameters::
|
10
|
+
# * *block* (Proc): Code called when the platform is setup
|
11
|
+
# * Parameters::
|
12
|
+
# * *repository* (String): Platform's repository
|
13
|
+
def with_test_platform_for_cli_test(&block)
|
14
|
+
with_test_platform(
|
15
|
+
{
|
16
|
+
nodes: { 'node' => { services: %w[service] } },
|
17
|
+
deployable_services: %w[service]
|
18
|
+
},
|
19
|
+
additional_config: 'read_secrets_from :cli',
|
20
|
+
&block
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'gets secrets from a file' do
|
25
|
+
with_test_platform_for_cli_test do |repository|
|
26
|
+
secrets_file = "#{repository}/my_secrets.json"
|
27
|
+
File.write(secrets_file, '{ "secret_name": "secret_value" }')
|
28
|
+
expect(test_services_handler).to receive(:package).with(
|
29
|
+
services: { 'node' => %w[service] },
|
30
|
+
secrets: { 'secret_name' => 'secret_value' },
|
31
|
+
local_environment: false
|
32
|
+
) { raise 'Abort as testing secrets is enough' }
|
33
|
+
expect { run 'deploy', '--node', 'node', '--secrets', secrets_file }.to raise_error 'Abort as testing secrets is enough'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'gets secrets from several files' do
|
38
|
+
with_test_platform_for_cli_test do |repository|
|
39
|
+
secrets_file_1 = "#{repository}/my_secrets1.json"
|
40
|
+
File.write(secrets_file_1, '{ "secret1": "value1" }')
|
41
|
+
secrets_file_2 = "#{repository}/my_secrets2.json"
|
42
|
+
File.write(secrets_file_2, '{ "secret2": "value2" }')
|
43
|
+
expect(test_services_handler).to receive(:package).with(
|
44
|
+
services: { 'node' => %w[service] },
|
45
|
+
secrets: { 'secret1' => 'value1', 'secret2' => 'value2' },
|
46
|
+
local_environment: false
|
47
|
+
) { raise 'Abort as testing secrets is enough' }
|
48
|
+
expect { run 'deploy', '--node', 'node', '--secrets', secrets_file_1, '--secrets', secrets_file_2 }.to raise_error 'Abort as testing secrets is enough'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'fails to get secrets from a missing file' do
|
53
|
+
with_test_platform_for_cli_test do
|
54
|
+
expect do
|
55
|
+
run 'deploy', '--node', 'node', '--secrets', 'unknown_file.json'
|
56
|
+
end.to raise_error 'Missing secrets file: unknown_file.json'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|