cloudamatic/mu

View on GitHub
bin/mu-azure-tests

Summary

Maintainability
Test Coverage
#!/usr/local/ruby-current/bin/ruby
# Copyright:: Copyright (c) 2014 eGlobalTech, Inc., all rights reserved
#
# Licensed under the BSD-3 license (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the root of the project or at
#
#     http://egt-labs.com/mu/LICENSE.html
#
# 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 'rubygems'
require 'bundler/setup'
require 'json'
require 'erb'
require 'optimist'
require 'json-schema'
require File.realpath(File.expand_path(File.dirname(__FILE__)+"/mu-load-config.rb"))
require 'mu'

(0..100000).to_a.each { |n|
retries = 0
seed = nil
#        begin
#          raise MuError, "Failed to allocate an unused MU-ID after #{retries} tries!" if retries > 70
#          seedsize = 1 + (retries/10).abs
#          seed = (0...seedsize+1).map { ('a'..'z').to_a[rand(26)] }.join
#        end while seed == "mu" or seed[0] == seed[1]
seed = "nn"
handle = MU::MommaCat.generateHandle(seed)
puts handle
}
exit

#pp MU::Cloud::Azure.listRegions
#pp MU::Cloud::Azure::Habitat.testcalls
#pp MU::Cloud::Azure::VPC.find(cloud_id: MU::Cloud::Azure::Id.new(resource_group: "mu", name: "mu-vnet"))
#pp MU::Cloud::Azure.authorization.role_assignments.list_for_resource_group("AKS-DEV-2019062015-KA-EASTUS")
#pp MU::Cloud::Azure::Role.find(role_name: "Azure Kubernetes Service Cluster Admin Role")
#puts MU::Cloud::Azure.default_subscription
#pp MU::Cloud::Azure.fetchPublicIP("MYVPC-DEV-2019061911-XI-EASTUS", "ip-addr-thingy")
#pp MU::Cloud::Azure.ensureProvider("egtazure", "Microsoft.ContainerService", force: true)
pp MU::Cloud::Azure::Server.find(cloud_id: "mu")
exit
pp MU::Cloud::Azure::Server.fetchImage("OpenLogic/CentOS/6")
pp MU::Cloud::Azure::Server.fetchImage("OpenLogic/CentOS/7")
pp MU::Cloud::Azure::Server.fetchImage("RedHat/RHEL/8")
pp MU::Cloud::Azure::Server.fetchImage("RedHat/RHEL/7")
pp MU::Cloud::Azure::Server.fetchImage("RedHat/RHEL/6")
pp MU::Cloud::Azure::Server.fetchImage("Debian/debian-10/10")
pp MU::Cloud::Azure::Server.fetchImage("MicrosoftWindowsServer/WindowsServer/2012-R2-Datacenter")
pp MU::Cloud::Azure::Server.fetchImage("MicrosoftWindowsServer/WindowsServer/2016-Datacenter")
pp MU::Cloud::Azure::Server.fetchImage("MicrosoftWindowsServer/WindowsServer/2019-Datacenter")