From ef24d437bcf8fecb008236d2f2aaa08291db254f Mon Sep 17 00:00:00 2001 From: siddheshwar-more Date: Wed, 17 Jul 2013 12:43:45 +0530 Subject: [PATCH] Incorporated review comments to add rspec test to check unique os disk name should generate on server create --- spec/unit/azure_server_create_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/unit/azure_server_create_spec.rb b/spec/unit/azure_server_create_spec.rb index 654f49a..e864aa3 100644 --- a/spec/unit/azure_server_create_spec.rb +++ b/spec/unit/azure_server_create_spec.rb @@ -115,6 +115,21 @@ describe "parameter test:" do Chef::Config[:knife][:azure_dns_name]) end + it "generate unique OS DiskName" do + os_disks = [] + @bootstrap.stub(:run) + Chef::Config[:knife][:azure_dns_name] = 'vmname' + + 5.times do + @server_instance.config[:azure_mgmt_cert] = "AzureLinuxCert.pem" + @server_instance.run + testxml = Nokogiri::XML(@receivedXML) + disklink = xml_content(testxml, 'MediaLink') + os_disks.should_not include(disklink) + os_disks.push(disklink) + end + end + it "advanced create" do # set all params Chef::Config[:knife][:azure_dns_name] = 'service001'