cloud-barista / poc-cb-spider

Proof of Concepts of CB-Spider. The CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project.
Apache License 2.0
1 stars 8 forks source link

[Azure Driver 1.0] need to Test #25

Open powerkimhub opened 5 years ago

powerkimhub commented 5 years ago
* Azure Driver 1.0 버전의 테스트 프로그램(Test_VM, Test_Resources, Test_Create) 반영에 대한 PR 요청. * 기존 Test.go 에 개발된 기능을 각 테스트 프로그램 속성에 맞게 분리. * Test_Create 테스트 프로그램에서 순차적으로 실행되는 리소스 생성 순서. 1. Virtual Network 생성 2. Security Group 생성 3. Public IP 생성 4. Virtual Network Interface 생성 5. VM 생성 * public SSH Key: poc-cb-spider/key/mcb-test-key.pub 파일 명으로 테스트 키를 생성 (시험 사용자 퍼블릭 키로 변경 후 테스트 필요) * VM 생성 시 베이스 이미지: Azure 제공 Ubuntu 16.04 LTS 퍼블릭 이미지 (config.yaml에 해당 이미지 정보 사전 정의)
issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

powerkimhub commented 5 years ago

<Test_Resources 시험 결과> (1) ImageHandler

(2) PublicIPHandler

(3) VNicHandler

        96                                 //PublicIPId:                "/subscriptions/cb592624-b77b-4a8f-bb13-0e5a48cae40f/resourceGroups/inno-platform1-rsrc-grup/providers/Microsoft.Network/publicIPAddresses/mcb-test-publicip", // @todo
        97                                 //changed by powerkim for test, 2019.09.02
        98                                 PublicIPId:                "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Network/publicIPAddresses/powerkim-test1-ip",
         99                         },
        100                 },
        101                 //SecurityGroupId: "/subscriptions/cb592624-b77b-4a8f-bb13-0e5a48cae40f/resourceGroups/inno-platform1-rsrc-grup/providers/Microsoft.Network/networkSecurityGroups/mcb-test-sg", // @todo
        102                 //edited by powerkim for test, 2019.08.13
        103                 //SecurityGroupId: "cb-security-group", // changed by powerkim, 2019.09.02
        104                 SecurityGroupId: "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Network/networkSecurityGroups/cb-security-group",

<Test_VM 시험 결과> PASS

<Test_Create 시험 결과> VM에 Public IP Attach가 안되어 있음.

    root@node12:~/go/src/github.com/cloud-barista/poc-cb-spider/cloud-driver/drivers/azure/main# go run Test_Create.go
    Azure Cloud Driver: called CreateVNetworkHandler()!
    Azure Cloud Driver: called CreateSecurityHandler()!
    Azure Cloud Driver: called CreatePublicIPHandler()!
    Azure Cloud Driver: called CreateVNicHandler()!
    Azure Cloud Driver: called CreateVMHandler()!
    Start CreateVNetwork() ...
    Finish CreateVNetwork()
    Start CreateSecurity() ...
    (*resources.SecurityInfo)(0xc0003350e0)({
     Id: (string) (len=143) "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Network/networkSecurityGroups/sec_name"                                                                                                                 ,
     Name: (string) (len=8) "sec_name",
     Location: (string) (len=12) "koreacentral",
     SecurityRules: ([]resources.SecurityRuleInfo) (len=2 cap=2) {
      (resources.SecurityRuleInfo) {
       Name: (string) (len=4) "HTTP",
       SourceAddressPrefix: (string) (len=1) "*",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=1) "*",
       DestinationPortRange: (string) (len=2) "80",
       Protocol: (string) (len=3) "TCP",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 300,
       Direction: (string) (len=7) "Inbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=3) "SSH",
       SourceAddressPrefix: (string) (len=1) "*",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=1) "*",
       DestinationPortRange: (string) (len=2) "22",
       Protocol: (string) (len=3) "TCP",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 320,
       Direction: (string) (len=7) "Inbound"
      }
     },
     DefaultSecurityRules: ([]resources.SecurityRuleInfo) (len=6 cap=8) {
      (resources.SecurityRuleInfo) {
       Name: (string) (len=16) "AllowVnetInBound",
       SourceAddressPrefix: (string) (len=14) "VirtualNetwork",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=14) "VirtualNetwork",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 65000,
       Direction: (string) (len=7) "Inbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=29) "AllowAzureLoadBalancerInBound",
       SourceAddressPrefix: (string) (len=17) "AzureLoadBalancer",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=1) "*",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 65001,
       Direction: (string) (len=7) "Inbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=14) "DenyAllInBound",
       SourceAddressPrefix: (string) (len=1) "*",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=1) "*",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=4) "Deny",
       Priority: (int32) 65500,
       Direction: (string) (len=7) "Inbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=17) "AllowVnetOutBound",
       SourceAddressPrefix: (string) (len=14) "VirtualNetwork",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=14) "VirtualNetwork",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 65000,
       Direction: (string) (len=8) "Outbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=21) "AllowInternetOutBound",
       SourceAddressPrefix: (string) (len=1) "*",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=8) "Internet",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=5) "Allow",
       Priority: (int32) 65001,
       Direction: (string) (len=8) "Outbound"
      },
      (resources.SecurityRuleInfo) {
       Name: (string) (len=15) "DenyAllOutBound",
       SourceAddressPrefix: (string) (len=1) "*",
       SourcePortRange: (string) (len=1) "*",
       DestinationAddressPrefix: (string) (len=1) "*",
       DestinationPortRange: (string) (len=1) "*",
       Protocol: (string) (len=1) "*",
       Access: (string) (len=4) "Deny",
       Priority: (int32) 65500,
       Direction: (string) (len=8) "Outbound"
      }
     }
    })
    Finish CreateSecurity()
    Start CreatePublicIP() ...
    (*resources.PublicIPInfo)(0xc00032f500)({
     Id: (string) (len=138) "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Network/publicIPAddresses/ip_name",
     Name: (string) (len=7) "ip_name",
     Location: (string) (len=12) "koreacentral",
     PublicIPAddressSku: (string) (len=5) "Basic",
     PublicIPAddressVersion: (string) (len=4) "IPv4",
     PublicIPAllocationMethod: (string) (len=6) "Static",
     IPAddress: (string) (len=13) "52.231.66.231",
     IdleTimeoutInMinutes: (int32) 4
    })
    Finish CreatePublicIP()
    Start CreateVNic() ...
    Finish CreateVNic()
    Start Create VM ...
    Finish Create VM
    (resources.VMInfo) {
     Name: (string) (len=7) "vm-name",
     Id: (string) (len=136) "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Compute/virtualMachines/vm-name",
     StartTime: (time.Time) 0001-01-01 00:00:00 +0000 UTC,
     Region: (resources.RegionInfo) {
      Region: (string) (len=12) "koreacentral",
      Zone: (string) ""
     },
     ImageID: (string) (len=41) "Canonical:UbuntuServer:16.04.0-LTS:latest",
     SpecID: (string) (len=13) "Standard_B1ls",
     VNetworkID: (string) "",
     SubNetworkID: (string) "",
     SecurityID: (string) "",
     VNIC: (string) (len=137) "/subscriptions/f1548292-2be3-4acd-84a4-6df079160846/resourceGroups/cb-resource-group/providers/Microsoft.Network/networkInterfaces/cb-nic",
     PublicIP: (string) "",
     PublicDNS: (string) "",
     PrivateIP: (string) "",
     PrivateDNS: (string) "",
     KeyPairID: (string) "",
     GuestUserID: (string) (len=8) "cbarista",
     GuestUserPwd: (string) "",
     GuestBootDisk: (string) (len=49) "vm-name_OsDisk_1_bdfeec453a8546bda7425d0c8f4a31f4",
     GuestBlockDisk: (string) "",
     AdditionalInfo: (string) ""
       }