diff --git a/embedded_files/cnf-testsuite-v2-example.yml b/embedded_files/cnf-testsuite-v2-example.yml new file mode 100644 index 000000000..0ac3d2066 --- /dev/null +++ b/embedded_files/cnf-testsuite-v2-example.yml @@ -0,0 +1,23 @@ +--- +config_version: "v2" +common: + container_names: + - name: coredns + rolling_update_test_tag: "1.8.0" + rolling_downgrade_test_tag: 1.6.7 + rolling_version_change_test_tag: 1.8.0 + rollback_from_tag: 1.8.0 + +deployments: + helm_charts: + - name: coredns + helm_repo_name: stable + helm_repo_url: https://cncf.gitlab.io/stable + helm_chart_name: coredns +# helm_dirs: +# - name: envoy +# helm_directory: ../example-cnfs/envoy/envoy +# manifests: +# - name: nginx +# manifest_directory: manifests + diff --git a/example-cnfs/envoy/cnf-testsuite.yml b/example-cnfs/envoy/cnf-testsuite.yml index e9b05505f..65e0e0ada 100644 --- a/example-cnfs/envoy/cnf-testsuite.yml +++ b/example-cnfs/envoy/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- release_name: envoy -service_name: envoy helm_directory: envoy diff --git a/example-cnfs/ip-forwarder/cnf-testsuite.yml b/example-cnfs/ip-forwarder/cnf-testsuite.yml index 3ca7a6b3b..966c3af64 100644 --- a/example-cnfs/ip-forwarder/cnf-testsuite.yml +++ b/example-cnfs/ip-forwarder/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- helm_directory: vpp release_name: vpp -service_name: "" rolling_update_test_tag: latest allowlist_helm_chart_container_names: [nginx, calico-node, kube-proxy, nginx-proxy, node-cache, kube-multus] diff --git a/example-cnfs/nsm/cnf-testsuite.yml b/example-cnfs/nsm/cnf-testsuite.yml index 12ceacb22..fbefd0659 100644 --- a/example-cnfs/nsm/cnf-testsuite.yml +++ b/example-cnfs/nsm/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: helm_chart release_name: nsm --set insecure=true -service_name: nsm-admission-webhook-svc helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/example-cnfs/pantheon-nsm-nat/cnf-testsuite.yml b/example-cnfs/pantheon-nsm-nat/cnf-testsuite.yml index 0f8fb0ba0..618e5d914 100644 --- a/example-cnfs/pantheon-nsm-nat/cnf-testsuite.yml +++ b/example-cnfs/pantheon-nsm-nat/cnf-testsuite.yml @@ -1,5 +1,4 @@ --- helm_directory: nat-cnf release_name: cnf-nat -service_name: allowlist_helm_chart_container_names: [node-cache, nginx, coredns, calico-node, kube-proxy, nginx-proxy, kube-multus] diff --git a/sample-cnfs/k8s-multiple-deployments/cnf-testsuite.yml b/sample-cnfs/k8s-multiple-deployments/cnf-testsuite.yml index 5ce210bfd..25857dc18 100644 --- a/sample-cnfs/k8s-multiple-deployments/cnf-testsuite.yml +++ b/sample-cnfs/k8s-multiple-deployments/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: chart release_name: sidecar-container-demo -service_name: helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/k8s-multiple-processes/cnf-testsuite.yml b/sample-cnfs/k8s-multiple-processes/cnf-testsuite.yml index eefd12541..78378d1fd 100644 --- a/sample-cnfs/k8s-multiple-processes/cnf-testsuite.yml +++ b/sample-cnfs/k8s-multiple-processes/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: chart release_name: sidecar-container-demo -service_name: helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/k8s-sidecar-container-pattern/cnf-testsuite.yml b/sample-cnfs/k8s-sidecar-container-pattern/cnf-testsuite.yml index 0ec2c4611..8d2db1eca 100644 --- a/sample-cnfs/k8s-sidecar-container-pattern/cnf-testsuite.yml +++ b/sample-cnfs/k8s-sidecar-container-pattern/cnf-testsuite.yml @@ -3,7 +3,6 @@ helm_directory: chart git_clone_url: install_script: release_name: sidecar-container-demo -service_name: helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-bad-helm-repo/cnf-testsuite.yml b/sample-cnfs/sample-bad-helm-repo/cnf-testsuite.yml index 1a4577921..bec56f08b 100644 --- a/sample-cnfs/sample-bad-helm-repo/cnf-testsuite.yml +++ b/sample-cnfs/sample-bad-helm-repo/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns -service_name: coredns-coredns helm_repository: name: badrepo repo_url: https://bad-helm-repo.googleapis.com diff --git a/sample-cnfs/sample-bad-zombie/cnf-testsuite.yml b/sample-cnfs/sample-bad-zombie/cnf-testsuite.yml index 8c7aecd3c..6ce0dd7a0 100644 --- a/sample-cnfs/sample-bad-zombie/cnf-testsuite.yml +++ b/sample-cnfs/sample-bad-zombie/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-bad_helm_coredns-cnf/cnf-testsuite.yml b/sample-cnfs/sample-bad_helm_coredns-cnf/cnf-testsuite.yml index 63b0ed15d..8d615ab61 100644 --- a/sample-cnfs/sample-bad_helm_coredns-cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample-bad_helm_coredns-cnf/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: bad-helm-coredns-coredns -service_name: bad-helm-coredns-coredns diff --git a/sample-cnfs/sample-coredns-cnf-bad-chart/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf-bad-chart/cnf-testsuite.yml index 4f9e77d77..d1206bfb1 100644 --- a/sample-cnfs/sample-coredns-cnf-bad-chart/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf-bad-chart/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-coredns-cnf-source/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf-source/cnf-testsuite.yml index e68f89810..a3f862543 100644 --- a/sample-cnfs/sample-coredns-cnf-source/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf-source/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- release_name: coredns -service_name: coredns-coredns helm_chart: stable/coredns diff --git a/sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml index 8c7aecd3c..6ce0dd7a0 100644 --- a/sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-coredns-cnf2/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf2/cnf-testsuite.yml index e4805093b..84ad7d477 100644 --- a/sample-cnfs/sample-coredns-cnf2/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf2/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns2 -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-coredns-cnf3/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf3/cnf-testsuite.yml index 3e48955a6..bcfe6b45a 100644 --- a/sample-cnfs/sample-coredns-cnf3/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf3/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns3 -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-coredns-cnf4/cnf-testsuite.yml b/sample-cnfs/sample-coredns-cnf4/cnf-testsuite.yml index e4324149f..7c6b20d64 100644 --- a/sample-cnfs/sample-coredns-cnf4/cnf-testsuite.yml +++ b/sample-cnfs/sample-coredns-cnf4/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns4 -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-fragile-state/cnf-testsuite.yml b/sample-cnfs/sample-fragile-state/cnf-testsuite.yml index e635c4527..6981ed8be 100644 --- a/sample-cnfs/sample-fragile-state/cnf-testsuite.yml +++ b/sample-cnfs/sample-fragile-state/cnf-testsuite.yml @@ -1,5 +1,4 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns rolling_update_test_tag: 1.6.7 diff --git a/sample-cnfs/sample-generic-cnf/cnf-testsuite.yml b/sample-cnfs/sample-generic-cnf/cnf-testsuite.yml index 283707935..8313b5d28 100644 --- a/sample-cnfs/sample-generic-cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample-generic-cnf/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: coredns-1609263557 -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-large-cnf/cnf-testsuite.yml b/sample-cnfs/sample-large-cnf/cnf-testsuite.yml index aa13803e3..ecf3e282f 100644 --- a/sample-cnfs/sample-large-cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample-large-cnf/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample-local-storage/cnf-testsuite.yml b/sample-cnfs/sample-local-storage/cnf-testsuite.yml index 89134a21c..40c14e685 100644 --- a/sample-cnfs/sample-local-storage/cnf-testsuite.yml +++ b/sample-cnfs/sample-local-storage/cnf-testsuite.yml @@ -2,4 +2,3 @@ helm_directory: chart helm_values: release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample-statefulset-cnf/cnf-testsuite.yml b/sample-cnfs/sample-statefulset-cnf/cnf-testsuite.yml index e2980bc1d..63c6b0e5b 100644 --- a/sample-cnfs/sample-statefulset-cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample-statefulset-cnf/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- release_name: test -service_name: helm_repository: name: bitnami repo_url: https://charts.bitnami.com/bitnami diff --git a/sample-cnfs/sample_bad_signal_handling/cnf-testsuite.yml b/sample-cnfs/sample_bad_signal_handling/cnf-testsuite.yml index c11a15362..451548f34 100644 --- a/sample-cnfs/sample_bad_signal_handling/cnf-testsuite.yml +++ b/sample-cnfs/sample_bad_signal_handling/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: envoy -service_name: envoy diff --git a/sample-cnfs/sample_coredns_bad_liveness/cnf-testsuite.yml b/sample-cnfs/sample_coredns_bad_liveness/cnf-testsuite.yml index a735c6fed..709d0e987 100644 --- a/sample-cnfs/sample_coredns_bad_liveness/cnf-testsuite.yml +++ b/sample-cnfs/sample_coredns_bad_liveness/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: bad-liveness -service_name: bad-liveness-coredns diff --git a/sample-cnfs/sample_coredns_hardcoded_ips/cnf-testsuite.yml b/sample-cnfs/sample_coredns_hardcoded_ips/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_coredns_hardcoded_ips/cnf-testsuite.yml +++ b/sample-cnfs/sample_coredns_hardcoded_ips/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_coredns_protected/cnf-testsuite.yml b/sample-cnfs/sample_coredns_protected/cnf-testsuite.yml index 88c2326a0..477628192 100644 --- a/sample-cnfs/sample_coredns_protected/cnf-testsuite.yml +++ b/sample-cnfs/sample_coredns_protected/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns --set imageCredentials.registry=https://index.docker.io/v1/ --set imageCredentials.username=$PROTECTED_DOCKERHUB_USERNAME --set imageCredentials.password=$PROTECTED_DOCKERHUB_PASSWORD --set imageCredentials.email=$PROTECTED_DOCKERHUB_EMAIL --set image.repository=$PROTECTED_IMAGE_REPO -service_name: coredns-coredns diff --git a/sample-cnfs/sample_envoy_slow_startup/cnf-testsuite.yml b/sample-cnfs/sample_envoy_slow_startup/cnf-testsuite.yml index c11a15362..451548f34 100644 --- a/sample-cnfs/sample_envoy_slow_startup/cnf-testsuite.yml +++ b/sample-cnfs/sample_envoy_slow_startup/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: envoy -service_name: envoy diff --git a/sample-cnfs/sample_good_signal_handling/cnf-testsuite.yml b/sample-cnfs/sample_good_signal_handling/cnf-testsuite.yml index c11a15362..451548f34 100644 --- a/sample-cnfs/sample_good_signal_handling/cnf-testsuite.yml +++ b/sample-cnfs/sample_good_signal_handling/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: envoy -service_name: envoy diff --git a/sample-cnfs/sample_good_signal_handling_tini/cnf-testsuite.yml b/sample-cnfs/sample_good_signal_handling_tini/cnf-testsuite.yml index 17367f5c4..5ad707c23 100644 --- a/sample-cnfs/sample_good_signal_handling_tini/cnf-testsuite.yml +++ b/sample-cnfs/sample_good_signal_handling_tini/cnf-testsuite.yml @@ -1,6 +1,5 @@ --- release_name: jenkins -service_name: jenkins helm_repository: name: jenkins repo_url: https://charts.jenkins.io diff --git a/sample-cnfs/sample_good_zombie_handling/cnf-testsuite.yml b/sample-cnfs/sample_good_zombie_handling/cnf-testsuite.yml index c11a15362..451548f34 100644 --- a/sample-cnfs/sample_good_zombie_handling/cnf-testsuite.yml +++ b/sample-cnfs/sample_good_zombie_handling/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: envoy -service_name: envoy diff --git a/sample-cnfs/sample_hostport/cnf-testsuite.yml b/sample-cnfs/sample_hostport/cnf-testsuite.yml index c30bc4352..f54caba50 100644 --- a/sample-cnfs/sample_hostport/cnf-testsuite.yml +++ b/sample-cnfs/sample_hostport/cnf-testsuite.yml @@ -3,4 +3,3 @@ helm_directory: chart git_clone_url: install_script: chart release_name: unifi -service_name: unifi-controller diff --git a/sample-cnfs/sample_immutable_configmap_all/cnf-testsuite.yml b/sample-cnfs/sample_immutable_configmap_all/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_immutable_configmap_all/cnf-testsuite.yml +++ b/sample-cnfs/sample_immutable_configmap_all/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_immutable_configmap_all_plus_env/cnf-testsuite.yml b/sample-cnfs/sample_immutable_configmap_all_plus_env/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_immutable_configmap_all_plus_env/cnf-testsuite.yml +++ b/sample-cnfs/sample_immutable_configmap_all_plus_env/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_immutable_configmap_all_plus_env_but_fail/cnf-testsuite.yml b/sample-cnfs/sample_immutable_configmap_all_plus_env_but_fail/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_immutable_configmap_all_plus_env_but_fail/cnf-testsuite.yml +++ b/sample-cnfs/sample_immutable_configmap_all_plus_env_but_fail/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_immutable_configmap_some/cnf-testsuite.yml b/sample-cnfs/sample_immutable_configmap_some/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_immutable_configmap_some/cnf-testsuite.yml +++ b/sample-cnfs/sample_immutable_configmap_some/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_local_registry/cnf-testsuite.yml b/sample-cnfs/sample_local_registry/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_local_registry/cnf-testsuite.yml +++ b/sample-cnfs/sample_local_registry/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_local_registry_org_image/cnf-testsuite.yml b/sample-cnfs/sample_local_registry_org_image/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_local_registry_org_image/cnf-testsuite.yml +++ b/sample-cnfs/sample_local_registry_org_image/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_local_registry_rolling/cnf-testsuite.yml b/sample-cnfs/sample_local_registry_rolling/cnf-testsuite.yml index 1410a29c8..acc179a44 100644 --- a/sample-cnfs/sample_local_registry_rolling/cnf-testsuite.yml +++ b/sample-cnfs/sample_local_registry_rolling/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns container_names: - name: coredns rolling_update_test_tag: "1.8.0" diff --git a/sample-cnfs/sample_network_loss/cnf-testsuite.yml b/sample-cnfs/sample_network_loss/cnf-testsuite.yml index d18e16f2a..c77d8f06f 100644 --- a/sample-cnfs/sample_network_loss/cnf-testsuite.yml +++ b/sample-cnfs/sample_network_loss/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns diff --git a/sample-cnfs/sample_nodeport/cnf-testsuite.yml b/sample-cnfs/sample_nodeport/cnf-testsuite.yml index e710fc0f8..f54caba50 100644 --- a/sample-cnfs/sample_nodeport/cnf-testsuite.yml +++ b/sample-cnfs/sample_nodeport/cnf-testsuite.yml @@ -3,4 +3,3 @@ helm_directory: chart git_clone_url: install_script: chart release_name: unifi -service_name: unifi-controller diff --git a/sample-cnfs/sample_privileged_cnf/cnf-testsuite.yml b/sample-cnfs/sample_privileged_cnf/cnf-testsuite.yml index 713882b59..f94fc524f 100644 --- a/sample-cnfs/sample_privileged_cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample_privileged_cnf/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: chart release_name: privileged-coredns -service_name: privileged-coredns diff --git a/sample-cnfs/sample_rolling_invalid_version/cnf-testsuite.yml b/sample-cnfs/sample_rolling_invalid_version/cnf-testsuite.yml index 864be01a4..ed6524bdf 100644 --- a/sample-cnfs/sample_rolling_invalid_version/cnf-testsuite.yml +++ b/sample-cnfs/sample_rolling_invalid_version/cnf-testsuite.yml @@ -1,7 +1,6 @@ --- helm_directory: chart release_name: coredns -service_name: coredns-coredns helm_repository: name: stable repo_url: https://cncf.gitlab.io/stable diff --git a/sample-cnfs/sample_secret_env/cnf-testsuite.yml b/sample-cnfs/sample_secret_env/cnf-testsuite.yml index 0e6283748..fd532eaac 100644 --- a/sample-cnfs/sample_secret_env/cnf-testsuite.yml +++ b/sample-cnfs/sample_secret_env/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: postgresql release_name: postgresql -service_name: postgresql diff --git a/sample-cnfs/sample_secret_env_no_ref/cnf-testsuite.yml b/sample-cnfs/sample_secret_env_no_ref/cnf-testsuite.yml index 0e6283748..fd532eaac 100644 --- a/sample-cnfs/sample_secret_env_no_ref/cnf-testsuite.yml +++ b/sample-cnfs/sample_secret_env_no_ref/cnf-testsuite.yml @@ -1,4 +1,3 @@ --- helm_directory: postgresql release_name: postgresql -service_name: postgresql diff --git a/sample-cnfs/sample_secret_volume/cnf-testsuite.yml b/sample-cnfs/sample_secret_volume/cnf-testsuite.yml index 102af59dc..e39401050 100644 --- a/sample-cnfs/sample_secret_volume/cnf-testsuite.yml +++ b/sample-cnfs/sample_secret_volume/cnf-testsuite.yml @@ -3,4 +3,3 @@ helm_directory: postgresql git_clone_url: install_script: chart release_name: postgresql -service_name: postgresql diff --git a/sample-cnfs/sample_unmounted_secret_volume/cnf-testsuite.yml b/sample-cnfs/sample_unmounted_secret_volume/cnf-testsuite.yml index 102af59dc..e39401050 100644 --- a/sample-cnfs/sample_unmounted_secret_volume/cnf-testsuite.yml +++ b/sample-cnfs/sample_unmounted_secret_volume/cnf-testsuite.yml @@ -3,4 +3,3 @@ helm_directory: postgresql git_clone_url: install_script: chart release_name: postgresql -service_name: postgresql diff --git a/sample-cnfs/sample_whitelisted_privileged_cnf/cnf-testsuite.yml b/sample-cnfs/sample_whitelisted_privileged_cnf/cnf-testsuite.yml index 85f263c06..b8cf1b853 100644 --- a/sample-cnfs/sample_whitelisted_privileged_cnf/cnf-testsuite.yml +++ b/sample-cnfs/sample_whitelisted_privileged_cnf/cnf-testsuite.yml @@ -1,5 +1,4 @@ --- helm_directory: chart release_name: privileged-coredns -service_name: privileged-coredns-coredns allowlist_helm_chart_container_names: [coredns] diff --git a/src/tasks/setup.cr b/src/tasks/setup.cr index bf2b9801b..d819a7e19 100644 --- a/src/tasks/setup.cr +++ b/src/tasks/setup.cr @@ -25,3 +25,11 @@ task "configuration_file_setup" do |_, args| CNFManager::Points.create_points_yml end +task "test_config" do |_, args| + if args.named["cfg"]? + puts CNFInstall::Config.parse_cnf_config_from_file(args.named["cfg"].to_s).inspect + else + stdout_failure "cfg parameter needed" + exit 1 + end +end diff --git a/src/tasks/utils/cnf_installation/config.cr b/src/tasks/utils/cnf_installation/config.cr new file mode 100644 index 000000000..6fcd97224 --- /dev/null +++ b/src/tasks/utils/cnf_installation/config.cr @@ -0,0 +1,32 @@ +require "yaml" +require "../utils.cr" +require "./config_versions/config_v2.cr" + +module CNFInstall + module Config + + class Config < ConfigV2::Config + end + + def self.parse_cnf_config_from_file(path_to_config) + yaml_content = File.read(path_to_config) + config_dir = CNFManager.ensure_cnf_testsuite_dir(path_to_config) + begin + parse_cnf_config_from_yaml(yaml_content, config_dir) + rescue exception + stdout_failure "Error during parsing CNF config on #{path_to_config}" + stdout_failure exception.message + stdout_failure "Please check your config according to the config template." + exit 1 + end + end + + def self.parse_cnf_config_from_yaml(yaml_content, config_dir) + config = Config.from_yaml(yaml_content) + + config.dynamic.initialize_dynamic_properties(config, config_dir) + + config + end + end +end diff --git a/src/tasks/utils/cnf_installation/config_versions/config_base.cr b/src/tasks/utils/cnf_installation/config_versions/config_base.cr new file mode 100644 index 000000000..362cd878a --- /dev/null +++ b/src/tasks/utils/cnf_installation/config_versions/config_base.cr @@ -0,0 +1,8 @@ +module CNFInstall + module Config + class ConfigBase + include YAML::Serializable + include YAML::Serializable::Strict + end + end +end \ No newline at end of file diff --git a/src/tasks/utils/cnf_installation/config_versions/config_v2.cr b/src/tasks/utils/cnf_installation/config_versions/config_v2.cr new file mode 100644 index 000000000..8e8fda43f --- /dev/null +++ b/src/tasks/utils/cnf_installation/config_versions/config_v2.cr @@ -0,0 +1,202 @@ +require "./config_base.cr" + + +module CNFInstall + module ConfigV2 + @[YAML::Serializable::Options(emit_nulls: true)] + alias AnyDeploymentConfig = HelmChartConfig | HelmDirectoryConfig | ManifestDirectoryConfig + + class Config < CNFInstall::Config::ConfigBase + getter config_version : String, + common = CommonParameters.new(), + dynamic = DynamicParameters.new(), + deployments : DeploymentsConfig + end + + class CommonParameters < CNFInstall::Config::ConfigBase + getter container_names = [] of ContainerParameters, + white_list_container_names = [] of String, + docker_insecure_registries = [] of String, + image_registry_fqdns = {} of String => String, + five_g_parameters = FiveGParameters.new() + def initialize() + end + end + + class DynamicParameters < CNFInstall::Config::ConfigBase + property source_cnf_dir = "", + destination_cnf_dir = "", + install_method : Tuple(CNFInstall::InstallMethod, String) = {CNFInstall::InstallMethod::Invalid, ""} + def initialize() + end + + def initialize_dynamic_properties(config, config_dir) + if @source_cnf_dir.empty? + @source_cnf_dir = config_dir + end + + if @install_method[0].is_a?(CNFInstall::InstallMethod::Invalid) + @install_method = config.deployments.get_install_method + end + + if @destination_cnf_dir.empty? + deployment_name = config.deployments.get_deployment_param(:name) + current_dir = FileUtils.pwd + @destination_cnf_dir = "#{current_dir}/#{CNF_DIR}/#{deployment_name}" + end + end + end + + class DeploymentsConfig < CNFInstall::Config::ConfigBase + getter helm_charts = [] of HelmChartConfig, + helm_dirs = [] of HelmDirectoryConfig, + manifests = [] of ManifestDirectoryConfig + # deployments.current and all related functionality should be removed with new installation process. + @@current : AnyDeploymentConfig | Nil + + def after_initialize + if @helm_charts.empty? && @helm_dirs.empty? && @manifests.empty? + raise YAML::Error.new("At least one deployment should be configured") + end + + # To be removed with new installation process. + if @helm_charts.size + @helm_dirs.size + @manifests.size > 1 + raise YAML::Error.new("Multiple deployments are not supported yet") + end + + deployment_names = Set(String).new + {@helm_charts, @helm_dirs, @manifests}.each do |deployment_array| + if deployment_array && !deployment_array.empty? + + # To be removed with new installation process. + @@current = deployment_array[0] + + deployment_array.each do |deployment| + if deployment_names.includes?(deployment.name) + raise YAML::Error.new("Deployment names should be unique: \"#{deployment.name}\"") + else + deployment_names.add(deployment.name) + end + end + end + end + end + + # To be removed with new installation process. + def get_deployment_param(param : Symbol) : String + current = @@current.not_nil! + allowed_params = [ + :name, :helm_repo_name, :helm_repo_url, :helm_chart_name, + :helm_values, :namespace, :helm_directory, :manifest_directory + ] + if !allowed_params.includes?(param) + raise ArgumentError.new("Unknown symbol for deployment: #{param}") + end + result = case current + when HelmChartConfig + case param + when :name then current.name + when :helm_repo_name then current.helm_repo_name + when :helm_repo_url then current.helm_repo_url + when :helm_chart_name then current.helm_chart_name + when :helm_values then current.helm_values + when :namespace then current.namespace + else "" + end + when HelmDirectoryConfig + case param + when :name then current.name + when :helm_directory then current.helm_directory + when :helm_values then current.helm_values + when :namespace then current.namespace + else "" + end + when ManifestDirectoryConfig + case param + when :name then current.name + when :manifest_directory then current.manifest_directory + else "" + end + end + result || "" + end + + # To be removed with new installation process. + def get_install_method + case @@current + when HelmChartConfig + {CNFInstall::InstallMethod::HelmChart, get_deployment_param(:helm_chart_name)} + when HelmDirectoryConfig + full_helm_directory = Path[CNF_DIR + "/" + get_deployment_param(:name) + "/" + CNFManager.sandbox_helm_directory(get_deployment_param(:helm_directory))].expand.to_s + {CNFInstall::InstallMethod::HelmDirectory, full_helm_directory} + when ManifestDirectoryConfig + full_manifest_directory = Path[CNF_DIR + "/" + get_deployment_param(:name) + "/" + CNFManager.sandbox_helm_directory(get_deployment_param(:manifest_directory))].expand.to_s + {CNFInstall::InstallMethod::ManifestDirectory, full_manifest_directory} + else + raise YAML::Error.new("At least one deployment should be configured") + end + end + end + + class DeploymentConfig < CNFInstall::Config::ConfigBase + getter name : String + end + + class HelmDeploymentConfig < DeploymentConfig + getter helm_values = "", + namespace = "" + + end + + class HelmChartConfig < HelmDeploymentConfig + getter helm_repo_name : String, + helm_repo_url : String, + helm_chart_name : String + end + + class HelmDirectoryConfig < HelmDeploymentConfig + getter helm_directory : String + end + + class ManifestDirectoryConfig < DeploymentConfig + getter manifest_directory : String + end + + class FiveGParameters < CNFInstall::Config::ConfigBase + getter amf_label = "", + smf_label = "", + upf_label = "", + ric_label = "", + amf_service_name = "", + mmc = "", + mnc = "", + sst = "", + sd = "", + tac = "", + protectionScheme = "", + publicKey = "", + publicKeyId = "", + routingIndicator = "", + enabled = "", + count = "", + initialMSISDN = "", + key = "", + op = "", + opType = "", + type = "", + apn = "", + emergency = "" + + def initialize() + end + end + + class ContainerParameters < CNFInstall::Config::ConfigBase + getter name = "", + rolling_update_test_tag = "", + rolling_downgrade_test_tag = "", + rolling_version_change_test_tag = "", + rollback_from_tag = "" + end + end +end \ No newline at end of file diff --git a/src/tasks/utils/cnf_installation/install_common.cr b/src/tasks/utils/cnf_installation/install_common.cr index 7862373c7..41a51248a 100644 --- a/src/tasks/utils/cnf_installation/install_common.cr +++ b/src/tasks/utils/cnf_installation/install_common.cr @@ -29,14 +29,6 @@ module CNFInstall end end - def self.cnf_installation_method(config : CNFManager::Config) : Tuple(CNFInstall::InstallMethod, String) - Log.info { "cnf_installation_method: #{config.cnf_config[:install_method]}" } - Log.info { "config_cnf_config: #{config.cnf_config}" } - yml_file_path = config.cnf_config[:source_cnf_file] - parsed_config_file = CNFManager.parsed_config_file(yml_file_path) - cnf_installation_method(parsed_config_file) - end - #Determine, for cnf, whether a helm chart, helm directory, or manifest directory is being used for installation def self.cnf_installation_method(config : Totem::Config) : Tuple(CNFInstall::InstallMethod, String) Log.info { "cnf_installation_method" } diff --git a/src/tasks/utils/cnf_manager.cr b/src/tasks/utils/cnf_manager.cr index c2c116aaf..f8d14087e 100644 --- a/src/tasks/utils/cnf_manager.cr +++ b/src/tasks/utils/cnf_manager.cr @@ -74,17 +74,16 @@ module CNFManager def self.cnf_resource_ymls(args, config) Log.info { "cnf_resource_ymls" } destination_cnf_dir = config.cnf_config[:destination_cnf_dir] - yml_file_path = config.cnf_config[:yml_file_path] helm_directory = sandbox_helm_directory(config.cnf_config[:helm_directory]) manifest_directory = config.cnf_config[:manifest_directory] release_name = config.cnf_config[:release_name] - helm_chart_path = config.cnf_config[:helm_chart_path] - manifest_file_path = config.cnf_config[:manifest_file_path] + helm_chart_path = Config.get_helm_chart_path(config) + manifest_file_path = Config.get_manifest_file_path(config) helm_values = config.cnf_config[:helm_values] test_passed = true deployment_namespace = CNFManager.get_deployment_namespace(config) - install_method = CNFInstall.cnf_installation_method(config) + install_method = config.cnf_config[:install_method] Log.debug { "install_method: #{install_method}" } template_ymls = [] of YAML::Any case install_method[0] @@ -134,7 +133,7 @@ module CNFManager # ``` def self.get_deployment_namespace(config) - install_method = CNFInstall.cnf_installation_method(config) + install_method = config.cnf_config[:install_method] case install_method[0] when CNFInstall::InstallMethod::HelmChart, CNFInstall::InstallMethod::HelmDirectory if !config.cnf_config[:helm_install_namespace].empty? @@ -503,10 +502,8 @@ module CNFManager release_name = config.cnf_config[:release_name] install_method = config.cnf_config[:install_method] helm_directory = config.cnf_config[:helm_directory] - source_helm_directory = config.cnf_config[:source_helm_directory] manifest_directory = config.cnf_config[:manifest_directory] - helm_chart_path = config.cnf_config[:helm_chart_path] - destination_cnf_dir = CNFManager.cnf_destination_dir(config_file) + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] # Create a CNF sandbox dir FileUtils.mkdir_p(destination_cnf_dir) @@ -535,7 +532,7 @@ module CNFManager end when CNFInstall::InstallMethod::HelmDirectory Log.info { "preparing helm_directory sandbox" } - source_directory = config_source_dir(config_file) + "/" + source_helm_directory.split(" ")[0] # todo support parameters separately + source_directory = config_source_dir(config_file) + "/" + helm_directory.split(" ")[0] # todo support parameters separately src_path = Path[source_directory].expand.to_s Log.info { "cp -a #{src_path} #{destination_cnf_dir}" } @@ -567,7 +564,7 @@ module CNFManager config_file = config.cnf_config[:source_cnf_dir] helm_directory = config.cnf_config[:helm_directory] helm_chart = config.cnf_config[:helm_chart] - destination_cnf_dir = CNFManager.cnf_destination_dir(config_file) + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] #TODO don't think we need to make this here FileUtils.mkdir_p("#{destination_cnf_dir}/#{helm_directory}") @@ -648,11 +645,9 @@ module CNFManager Log.info { "helm_repo_name: #{helm_repo_name}" } Log.info { "helm_repo_url: #{helm_repo_url}" } - - helm_chart_path = config.cnf_config[:helm_chart_path] Log.debug { "helm_directory: #{helm_directory}" } - destination_cnf_dir = CNFManager.cnf_destination_dir(config_file) + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] Log.for("verbose").info { "destination_cnf_dir: #{destination_cnf_dir}" } if verbose Log.debug { "mkdir_p destination_cnf_dir: #{destination_cnf_dir}" } @@ -896,7 +891,6 @@ module CNFManager helm_repository = config.cnf_config[:helm_repository] helm_repo_name = "#{helm_repository && helm_repository["name"]}" helm_repo_url = "#{helm_repository && helm_repository["repo_url"]}" - helm_chart_path = config.cnf_config[:helm_chart_path] helm_chart = config.cnf_config[:helm_chart] destination_cnf_dir = config.cnf_config[:destination_cnf_dir] deployment_namespace = CNFManager.get_deployment_namespace(config) @@ -946,11 +940,12 @@ module CNFManager def self.sample_cleanup(config_file, force=false, installed_from_manifest=false, verbose=true) Log.info { "sample_cleanup" } Log.info { "sample_cleanup installed_from_manifest: #{installed_from_manifest}" } - destination_cnf_dir = CNFManager.cnf_destination_dir(config_file) - Log.info { "destination_cnf_dir: #{destination_cnf_dir}" } config = parsed_config_file(ensure_cnf_testsuite_yml_path(config_file)) parsed_config = CNFManager::Config.parse_config_yml(CNFManager.ensure_cnf_testsuite_yml_path(config_file)) Log.for("verbose").info { "cleanup config: #{config.inspect}" } if verbose + destination_cnf_dir = parsed_config.cnf_config[:destination_cnf_dir] + Log.info { "destination_cnf_dir: #{destination_cnf_dir}" } + config_maps_dir = "#{destination_cnf_dir}/config_maps" if Dir.exists?(config_maps_dir) @@ -974,7 +969,7 @@ module CNFManager Log.for("sample_cleanup").info { "Destination dir #{destination_cnf_dir} exists" } end - install_method = CNFInstall.cnf_installation_method(parsed_config) + install_method = parsed_config.cnf_config[:install_method] Log.for("sample_cleanup:install_method").info { install_method } case install_method[0] when CNFInstall::InstallMethod::HelmChart, CNFInstall::InstallMethod::HelmDirectory diff --git a/src/tasks/utils/config.cr b/src/tasks/utils/config.cr index 52e8132bf..5faa5a2a2 100644 --- a/src/tasks/utils/config.cr +++ b/src/tasks/utils/config.cr @@ -14,22 +14,15 @@ module CNFManager end #when addeding to this you must add to task.cr's CNFManager::Config.new( property cnf_config : NamedTuple(destination_cnf_dir: String, - source_cnf_file: String, source_cnf_dir: String, - yml_file_path: String, install_method: Tuple(CNFInstall::InstallMethod, String), manifest_directory: String, helm_directory: String, - source_helm_directory: String, - helm_chart_path: String, - manifest_file_path: String, release_name: String, - service_name: String, helm_repository: NamedTuple(name: String, repo_url: String) | Nil, helm_chart: String, helm_values: String, helm_install_namespace: String, - rolling_update_tag: String, container_names: Array(Hash(String, String )) | Nil, white_list_container_names: Array(String), docker_insecure_registries: Array(String) | Nil, @@ -74,9 +67,7 @@ module CNFManager destination_cnf_dir = CNFManager.cnf_destination_dir(yml_file) - yml_file_path = CNFManager.ensure_cnf_testsuite_dir(config_yml_path) - source_cnf_file = yml_file - source_cnf_dir = yml_file_path + source_cnf_dir = CNFManager.ensure_cnf_testsuite_dir(config_yml_path) manifest_directory = optional_key_as_string(config, "manifest_directory") if config["helm_repository"]? helm_repository = config["helm_repository"].as_h @@ -89,9 +80,7 @@ module CNFManager helm_chart = optional_key_as_string(config, "helm_chart") helm_values = optional_key_as_string(config, "helm_values") release_name = optional_key_as_string(config, "release_name") - service_name = optional_key_as_string(config, "service_name") helm_directory = optional_key_as_string(config, "helm_directory") - source_helm_directory = optional_key_as_string(config, "helm_directory") helm_install_namespace = optional_key_as_string(config, "helm_install_namespace") if config["enabled"]? core_enabled = config["enabled"].as_bool.to_s @@ -132,21 +121,7 @@ module CNFManager smf = optional_key_as_string(config, "smf_label") upf = optional_key_as_string(config, "upf_label") ric = optional_key_as_string(config, "ric_label") - if helm_directory.empty? - working_chart_directory = "exported_chart" - Log.info { "USING EXPORTED CHART PATH" } - else - # todo separate parameters from helm directory - # TODO Fix bug with helm_directory for arguments, it creates an invalid path - # # we don't handle arguments anymore - # helm_directory = source_helm_directory.split("/")[0] + " " + source_helm_directory.split(" ")[1..-1].join(" ") - # helm_directory = optional_key_as_string(config, "helm_directory") - working_chart_directory = helm_directory - Log.info { "NOT USING EXPORTED CHART PATH" } - end - helm_chart_path = destination_cnf_dir + "/" + CNFManager.sandbox_helm_directory(working_chart_directory) - helm_chart_path = Path[helm_chart_path].expand.to_s - manifest_file_path = destination_cnf_dir + "/" + "temp_template.yml" + white_list_container_names = optional_key_as_string(config, "allowlist_helm_chart_container_names") if config["allowlist_helm_chart_container_names"]? white_list_container_names = config["allowlist_helm_chart_container_names"].as_a.map do |c| @@ -190,22 +165,15 @@ module CNFManager # if you change this, change instantiation in task.cr/single_task_runner as well new({ destination_cnf_dir: destination_cnf_dir, - source_cnf_file: source_cnf_file, source_cnf_dir: source_cnf_dir, - yml_file_path: yml_file_path, install_method: install_method, manifest_directory: manifest_directory, helm_directory: helm_directory, - source_helm_directory: source_helm_directory, - helm_chart_path: helm_chart_path, - manifest_file_path: manifest_file_path, release_name: release_name, - service_name: service_name, helm_repository: {name: helm_repo_name, repo_url: helm_repo_url}, helm_chart: helm_chart, helm_values: helm_values, helm_install_namespace: helm_install_namespace, - rolling_update_tag: "", container_names: container_names, white_list_container_names: white_list_container_names, docker_insecure_registries: docker_insecure_registries, @@ -217,6 +185,26 @@ module CNFManager image_registry_fqdns: image_registry_fqdns,}) end + + def self.get_helm_chart_path(config) + helm_directory = config.cnf_config[:helm_directory] + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] + if helm_directory.empty? + working_chart_directory = "exported_chart" + Log.info { "USING EXPORTED CHART PATH" } + else + working_chart_directory = helm_directory + Log.info { "NOT USING EXPORTED CHART PATH" } + end + helm_chart_path = destination_cnf_dir + "/" + CNFManager.sandbox_helm_directory(working_chart_directory) + helm_chart_path = Path[helm_chart_path].expand.to_s + end + + def self.get_manifest_file_path(config) + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] + manifest_file_path = destination_cnf_dir + "/" + "temp_template.yml" + end + def self.install_method_by_config_file(config_file) : CNFInstall::InstallMethod LOGGING.info "install_data_by_config_file" config = CNFManager.parsed_config_file(config_file) diff --git a/src/tasks/utils/task.cr b/src/tasks/utils/task.cr index b24473736..2f07e9a9a 100644 --- a/src/tasks/utils/task.cr +++ b/src/tasks/utils/task.cr @@ -65,22 +65,15 @@ module CNFManager config = CNFManager::Config.parse_config_yml(args.named["cnf-config"].as(String)) else config = CNFManager::Config.new({ destination_cnf_dir: "", - source_cnf_file: "", source_cnf_dir: "", - yml_file_path: "", install_method: {CNFInstall::InstallMethod::HelmChart, ""}, manifest_directory: "", helm_directory: "", - source_helm_directory: "", - helm_chart_path: "", - manifest_file_path: "", release_name: "", - service_name: "", helm_repository: {name: "", repo_url: ""}, helm_chart: "", helm_values: "", helm_install_namespace: "", - rolling_update_tag: "", container_names: [{"name" => "", "rolling_update_test_tag" => ""}], white_list_container_names: [""], docker_insecure_registries: [] of String, diff --git a/src/tasks/utils/types/cnf_testsuite_yml_type.cr b/src/tasks/utils/types/cnf_testsuite_yml_type.cr index 437d57eb1..0d01c9afa 100644 --- a/src/tasks/utils/types/cnf_testsuite_yml_type.cr +++ b/src/tasks/utils/types/cnf_testsuite_yml_type.cr @@ -22,8 +22,6 @@ class CnfTestSuiteYmlType property helm_directory : String? - property service_name : String? - property release_name : String? property helm_repository : HelmRepositoryType? @@ -32,10 +30,6 @@ class CnfTestSuiteYmlType property helm_install_namespace : String? - # property rolling_update_test_tag : String? - # property rolling_downgrade_test_tag : String? - # property rolling_version_change_test_tag : String? - property rollback_from_tag : String? property allowlist_helm_chart_container_names : Array(String)? diff --git a/src/tasks/workload/compatibility.cr b/src/tasks/workload/compatibility.cr index d65e4c752..e4a46b2cb 100644 --- a/src/tasks/workload/compatibility.cr +++ b/src/tasks/workload/compatibility.cr @@ -393,7 +393,6 @@ task "helm_deploy" do |t, args| helm_chart = config.cnf_config[:helm_chart] helm_directory = config.cnf_config[:helm_directory] release_name = config.cnf_config[:release_name] - yml_file_path = config.cnf_config[:yml_file_path] configmap = KubectlClient::Get.configmap("cnf-testsuite-#{release_name}-startup-information") #TODO check if json is empty helm_used = configmap["data"].as_h["helm_used"].as_s @@ -451,7 +450,7 @@ task "helm_chart_published", ["helm_local_install"] do |t, args| end task "helm_chart_valid", ["helm_local_install"] do |t, args| - CNFManager::Task.task_runner(args, task: t) do |args| + CNFManager::Task.task_runner(args, task: t) do |args, config| if check_verbose(args) Log.for("verbose").debug { "helm_chart_valid args.raw: #{args.raw}" } Log.for("verbose").debug { "helm_chart_valid args.named: #{args.named}" } @@ -459,9 +458,7 @@ task "helm_chart_valid", ["helm_local_install"] do |t, args| response = String::Builder.new - config = CNFManager.parsed_config_file(CNFManager.ensure_cnf_testsuite_yml_path(args.named["cnf-config"].as(String))) - # helm_directory = config.get("helm_directory").as_s - helm_directory = optional_key_as_string(config, "helm_directory") + helm_directory = config.cnf_config[:helm_directory] if helm_directory.empty? working_chart_directory = "exported_chart" else @@ -478,7 +475,7 @@ task "helm_chart_valid", ["helm_local_install"] do |t, args| Log.for(t.name).debug { "current dir: #{current_dir}" } helm = Helm::BinarySingleton.helm - destination_cnf_dir = CNFManager.cnf_destination_dir(CNFManager.ensure_cnf_testsuite_dir(args.named["cnf-config"].as(String))) + destination_cnf_dir = config.cnf_config[:destination_cnf_dir] helm_lint_cmd = "#{helm} lint #{destination_cnf_dir}/#{working_chart_directory}" helm_lint_status = Process.run( diff --git a/src/tasks/workload/configuration.cr b/src/tasks/workload/configuration.cr index ca3e4073a..d8e4b9040 100644 --- a/src/tasks/workload/configuration.cr +++ b/src/tasks/workload/configuration.cr @@ -107,7 +107,7 @@ task "ip_addresses" do |t, args| cdir = FileUtils.pwd() response = String::Builder.new helm_directory = config.cnf_config[:helm_directory] - helm_chart_path = config.cnf_config[:helm_chart_path] + helm_chart_path = CNFManager::Config.get_helm_chart_path(config) Log.info { "Path: #{helm_chart_path}" } if File.directory?(helm_chart_path) # Switch to the helm chart directory @@ -191,7 +191,6 @@ task "nodeport_not_used" do |t, args| # TODO rename task_runner to multi_cnf_task_runner CNFManager::Task.task_runner(args, task: t) do |args, config| release_name = config.cnf_config[:release_name] - service_name = config.cnf_config[:service_name] destination_cnf_dir = config.cnf_config[:destination_cnf_dir] task_response = CNFManager.workload_resource_test(args, config, check_containers: false, check_service: true) do |resource, container, initialized| Log.for(t.name).info { "nodeport_not_used resource: #{resource}" } @@ -222,7 +221,6 @@ desc "Does the CNF use HostPort" task "hostport_not_used" do |t, args| CNFManager::Task.task_runner(args, task: t) do |args, config| release_name = config.cnf_config[:release_name] - service_name = config.cnf_config[:service_name] destination_cnf_dir = config.cnf_config[:destination_cnf_dir] task_response = CNFManager.workload_resource_test(args, config, check_containers: false, check_service: true) do |resource, container, initialized| diff --git a/src/tasks/workload/microservice.cr b/src/tasks/workload/microservice.cr index a2c7a486c..a4301572f 100644 --- a/src/tasks/workload/microservice.cr +++ b/src/tasks/workload/microservice.cr @@ -104,7 +104,6 @@ end desc "Does the CNF have a reasonable startup time (< 30 seconds)?" task "reasonable_startup_time" do |t, args| CNFManager::Task.task_runner(args, task: t) do |args, config| - yml_file_path = config.cnf_config[:yml_file_path] helm_chart = config.cnf_config[:helm_chart] helm_directory = config.cnf_config[:helm_directory] release_name = config.cnf_config[:release_name] @@ -199,7 +198,7 @@ task "reasonable_image_size" do |t, args| Log.for(t.name).debug { "cnf_config: #{config}" } task_response = CNFManager.workload_resource_test(args, config) do |resource, container, initialized| - yml_file_path = config.cnf_config[:yml_file_path] + source_cnf_dir = config.cnf_config[:source_cnf_dir] if resource["kind"].downcase == "deployment" || resource["kind"].downcase == "statefulset" || @@ -245,9 +244,9 @@ task "reasonable_image_size" do |t, args| }[0..-2]}}}) puts "str_auths: #{str_auths}" end - File.write("#{yml_file_path}/config.json", str_auths) + File.write("#{source_cnf_dir}/config.json", str_auths) Dockerd.exec("mkdir -p /root/.docker/") - KubectlClient.cp("#{yml_file_path}/config.json #{TESTSUITE_NAMESPACE}/dockerd:/root/.docker/config.json") + KubectlClient.cp("#{source_cnf_dir}/config.json #{TESTSUITE_NAMESPACE}/dockerd:/root/.docker/config.json") end Log.info { "FQDN of the docker image: #{fqdn_image}" } diff --git a/src/tasks/workload/observability.cr b/src/tasks/workload/observability.cr index 51d94ce27..eac6d4f97 100644 --- a/src/tasks/workload/observability.cr +++ b/src/tasks/workload/observability.cr @@ -224,7 +224,6 @@ task "tracing" do |t, args| helm_chart = config.cnf_config[:helm_chart] helm_directory = config.cnf_config[:helm_directory] release_name = config.cnf_config[:release_name] - yml_file_path = config.cnf_config[:yml_file_path] configmap = KubectlClient::Get.configmap("cnf-testsuite-#{release_name}-startup-information") #TODO check if json is empty tracing_used = configmap["data"].as_h["tracing_used"].as_s diff --git a/src/tasks/workload/ran.cr b/src/tasks/workload/ran.cr index a52a2950e..946a99b0e 100644 --- a/src/tasks/workload/ran.cr +++ b/src/tasks/workload/ran.cr @@ -17,7 +17,6 @@ desc "Test if RAN uses the ORAN e2 interface" task "oran_e2_connection" do |t, args| CNFManager::Task.task_runner(args, task: t) do |args, config| release_name = config.cnf_config[:release_name] - destination_cnf_dir = CNFManager.cnf_destination_dir(CNFManager.ensure_cnf_testsuite_dir(args.named["cnf-config"].as(String))) if ORANMonitor.isCNFaRIC?(config.cnf_config) configmap = KubectlClient::Get.configmap("cnf-testsuite-#{release_name}-startup-information") e2_found = configmap["data"].as_h["e2_found"].as_s @@ -29,7 +28,7 @@ task "oran_e2_connection" do |t, args| CNFManager::TestcaseResult.new(CNFManager::ResultStatus::Failed, "RAN does not connect to a RIC using the e2 standard interface") end else - CNFManager::TestcaseResult.new(CNFManager::ResultStatus::NA, "[oran_e2_connection] No ric designated in cnf_testsuite.yml for #{destination_cnf_dir}") + CNFManager::TestcaseResult.new(CNFManager::ResultStatus::NA, "[oran_e2_connection] No ric designated in cnf_testsuite.yml") end end