diff --git a/spec/integration/resource/managed_san/create_spec.rb b/spec/integration/resource/managed_san/create_spec.rb new file mode 100644 index 000000000..9f53c7e9b --- /dev/null +++ b/spec/integration/resource/managed_san/create_spec.rb @@ -0,0 +1,38 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::ManagedSAN +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + let(:fc_options) do + { + connectionTemplateUri: nil, + autoLoginRedistribution: true, + fabricType: 'FabricAttach' + } + end + + describe 'Import SANs' do + it 'create fc networks' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + options = fc_options + options[:name] = "FC_#{san['name']}" + options[:managedSanUri] = san['uri'] + fc = OneviewSDK::FCNetwork.new($client, options) + fc.create + expect(fc['uri']).to be + end + end + end +end diff --git a/spec/integration/resource/managed_san/delete_spec.rb b/spec/integration/resource/managed_san/delete_spec.rb new file mode 100644 index 000000000..15647c241 --- /dev/null +++ b/spec/integration/resource/managed_san/delete_spec.rb @@ -0,0 +1,27 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::ManagedSAN +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe 'Remove FC Networks' do + it 'Remove' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + fc = OneviewSDK::FCNetwork.new($client, name: "FC_#{san['name']}") + fc.retrieve! + fc.delete + end + end + end +end diff --git a/spec/integration/resource/managed_san/update_spec.rb b/spec/integration/resource/managed_san/update_spec.rb index 8c3b7ddc4..1b2399cdd 100644 --- a/spec/integration/resource/managed_san/update_spec.rb +++ b/spec/integration/resource/managed_san/update_spec.rb @@ -15,7 +15,15 @@ include_context 'integration context' before :each do - @item = OneviewSDK::ManagedSAN.find_by($client, {}).first + @item = OneviewSDK::ManagedSAN.find_by($client, state: 'Managed').first + end + + describe 'Check if SANs were imported' do + it 'check if SAN was imported' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + expect(san['state']).to eq('Managed') + end + end end describe '#get_endpoints' do @@ -34,19 +42,16 @@ it 'Update public attributes' do attributes = [ { - name: 'MetaSan', - value: 'Neon SAN', - valueType: 'String', - valueFormat: 'None' + 'name' => 'MetaSan', + 'value' => 'Neon SAN', + 'valueType' => 'String', + 'valueFormat' => 'None', + 'displayName' => nil, + 'required' => false } ] expect { @item.set_public_attributes(attributes) }.not_to raise_error - item_attributes = @item['publicAttributes'] - attributes.each_with_index do |attr, index| - attr.each do |key, value| - expect(value).to eq(item_attributes[index][key.to_s]) - end - end + expect(@item['publicAttributes']).to eq(attributes) end end diff --git a/spec/integration/resource/san_manager/create_spec.rb b/spec/integration/resource/san_manager/create_spec.rb index 9871c9c63..eb597ea90 100644 --- a/spec/integration/resource/san_manager/create_spec.rb +++ b/spec/integration/resource/san_manager/create_spec.rb @@ -37,7 +37,7 @@ describe '#self.get_default_connection_info' do it 'Retrieve connection info for provider' do - expect { OneviewSDK::SANManager.get_default_connection_info($client, SAN_PROVIDER1_NAME) } + expect { OneviewSDK::SANManager.get_default_connection_info($client, SAN_PROVIDER1_NAME) }.to_not raise_error end end end diff --git a/spec/support/hp-firmware-a1b08f8a6b-HPGH-1.1.i386.rpm b/spec/support/hp-firmware-a1b08f8a6b-HPGH-1.1.i386.rpm deleted file mode 100644 index 16813eb65..000000000 Binary files a/spec/support/hp-firmware-a1b08f8a6b-HPGH-1.1.i386.rpm and /dev/null differ