From d8ae438146e8344fcb6d6b2b7b5a8ac7233a2ba2 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 28 Sep 2023 17:24:18 -0400 Subject: [PATCH] Add EMS #pause! and #resume! specs --- .../providers/azure/cloud_manager_spec.rb | 14 +++++++++++ .../providers/azure/container_manager_spec.rb | 23 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 spec/models/manageiq/providers/azure/container_manager_spec.rb diff --git a/spec/models/manageiq/providers/azure/cloud_manager_spec.rb b/spec/models/manageiq/providers/azure/cloud_manager_spec.rb index fb48e568..9d178e1f 100644 --- a/spec/models/manageiq/providers/azure/cloud_manager_spec.rb +++ b/spec/models/manageiq/providers/azure/cloud_manager_spec.rb @@ -54,6 +54,20 @@ end end + context "#pause!" do + let(:zone) { FactoryBot.create(:zone) } + let(:ems) { FactoryBot.create(:ems_azure, :zone => zone) } + + include_examples "ExtManagementSystem#pause!" + end + + context "#resume!" do + let(:zone) { FactoryBot.create(:zone) } + let(:ems) { FactoryBot.create(:ems_azure, :zone => zone) } + + include_examples "ExtManagementSystem#resume!" + end + it "does not create orphaned network_manager" do # When the cloud_manager is destroyed during a refresh the there will still be an instance # of the cloud_manager in the refresh worker. After the refresh we will try to save the cloud_manager diff --git a/spec/models/manageiq/providers/azure/container_manager_spec.rb b/spec/models/manageiq/providers/azure/container_manager_spec.rb new file mode 100644 index 00000000..5c8b135f --- /dev/null +++ b/spec/models/manageiq/providers/azure/container_manager_spec.rb @@ -0,0 +1,23 @@ +describe ManageIQ::Providers::Azure::ContainerManager do + it ".ems_type" do + expect(described_class.ems_type).to eq('aks') + end + + it ".description" do + expect(described_class.description).to eq('Azure Kubernetes Service') + end + + context "#pause!" do + let(:zone) { FactoryBot.create(:zone) } + let(:ems) { FactoryBot.create(:ems_azure_aks, :zone => zone) } + + include_examples "ExtManagementSystem#pause!" + end + + context "#resume!" do + let(:zone) { FactoryBot.create(:zone) } + let(:ems) { FactoryBot.create(:ems_azure_aks, :zone => zone) } + + include_examples "ExtManagementSystem#resume!" + end +end