knife-google 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/CONTRIB.md +64 -0
- data/Gemfile +11 -0
- data/README.md +287 -0
- data/Rakefile +53 -0
- data/knife-google.gemspec +26 -0
- data/lib/chef/knife/google_base.rb +39 -68
- data/lib/chef/knife/google_disk_create.rb +60 -0
- data/lib/chef/knife/google_disk_delete.rb +60 -0
- data/lib/chef/knife/google_disk_list.rb +75 -0
- data/lib/chef/knife/google_server_create.rb +273 -184
- data/lib/chef/knife/google_server_delete.rb +74 -32
- data/lib/chef/knife/google_server_list.rb +45 -64
- data/lib/chef/knife/google_setup.rb +31 -0
- data/lib/chef/knife/google_zone_list.rb +78 -0
- data/lib/google/compute.rb +46 -0
- data/lib/google/compute/client.rb +188 -0
- data/lib/google/compute/config.rb +23 -0
- data/lib/google/compute/creatable_resource_collection.rb +38 -0
- data/lib/google/compute/deletable_resource_collection.rb +51 -0
- data/lib/google/compute/disk.rb +40 -0
- data/lib/google/compute/exception.rb +28 -0
- data/lib/google/compute/firewall.rb +65 -0
- data/lib/google/compute/global_operation.rb +60 -0
- data/lib/google/compute/image.rb +30 -0
- data/lib/google/compute/kernel.rb +20 -0
- data/lib/google/compute/listable_resource_collection.rb +33 -0
- data/lib/google/compute/machine_type.rb +36 -0
- data/lib/google/compute/mixins/utils.rb +58 -0
- data/lib/google/compute/network.rb +29 -0
- data/lib/google/compute/project.rb +76 -0
- data/lib/google/compute/resource.rb +81 -0
- data/lib/google/compute/resource_collection.rb +78 -0
- data/lib/google/compute/server.rb +87 -0
- data/lib/google/compute/server/attached_disk.rb +39 -0
- data/lib/google/compute/server/network_interface.rb +38 -0
- data/lib/google/compute/server/network_interface/access_config.rb +35 -0
- data/lib/google/compute/server/serial_port_output.rb +31 -0
- data/lib/google/compute/snapshot.rb +30 -0
- data/lib/google/compute/version.rb +19 -0
- data/lib/google/compute/zone.rb +32 -0
- data/lib/google/compute/zone_operation.rb +60 -0
- data/lib/knife-google/version.rb +18 -2
- data/spec/chef/knife/google_base_spec.rb +46 -0
- data/spec/chef/knife/google_disk_create_spec.rb +36 -0
- data/spec/chef/knife/google_disk_delete_spec.rb +65 -0
- data/spec/chef/knife/google_disk_list_spec.rb +36 -0
- data/spec/chef/knife/google_server_create_spec.rb +84 -0
- data/spec/chef/knife/google_server_delete_spec.rb +105 -0
- data/spec/chef/knife/google_server_list_spec.rb +39 -0
- data/spec/chef/knife/google_setup_spec.rb +25 -0
- data/spec/chef/knife/google_zone_list_spec.rb +32 -0
- data/spec/data/client.json +14 -0
- data/spec/data/compute-v1beta14.json +3386 -0
- data/spec/data/disk.json +15 -0
- data/spec/data/firewall.json +13 -0
- data/spec/data/global_operation.json +36 -0
- data/spec/data/image.json +12 -0
- data/spec/data/kernel.json +15 -0
- data/spec/data/machine_type.json +24 -0
- data/spec/data/network.json +10 -0
- data/spec/data/project.json +21 -0
- data/spec/data/serial_port_output.json +5 -0
- data/spec/data/server.json +46 -0
- data/spec/data/snapshot.json +12 -0
- data/spec/data/zone.json +30 -0
- data/spec/data/zone_operation.json +36 -0
- data/spec/google/compute/disk_spec.rb +105 -0
- data/spec/google/compute/firewall_spec.rb +128 -0
- data/spec/google/compute/global_operation_spec.rb +62 -0
- data/spec/google/compute/image_spec.rb +75 -0
- data/spec/google/compute/kernel_spec.rb +49 -0
- data/spec/google/compute/machine_type_spec.rb +53 -0
- data/spec/google/compute/network_spec.rb +68 -0
- data/spec/google/compute/project_spec.rb +71 -0
- data/spec/google/compute/server_spec.rb +125 -0
- data/spec/google/compute/snapshot_spec.rb +69 -0
- data/spec/google/compute/zone_operation_spec.rb +62 -0
- data/spec/google/compute/zone_spec.rb +50 -0
- data/spec/spec_helper.rb +44 -0
- data/spec/support/mocks.rb +62 -0
- data/spec/support/resource_examples.rb +70 -0
- data/spec/support/spec_google_base.rb +56 -0
- metadata +121 -31
- data/README.rdoc +0 -96
data/spec/data/disk.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#disk",
|
3
|
+
"id":"130300000000098",
|
4
|
+
"creationTimestamp":"2012-11-09 11:46:03 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone/disks/mock-disk",
|
6
|
+
"name":"mock-disk",
|
7
|
+
"description":"some random text",
|
8
|
+
"sizeGb":"10",
|
9
|
+
"zone":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone",
|
10
|
+
"options":"",
|
11
|
+
"status":"READY",
|
12
|
+
"sourceSnapshot":"",
|
13
|
+
"sourceSnapshotId":"",
|
14
|
+
"sourceImage":""
|
15
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#firewall",
|
3
|
+
"id":"49323322222222",
|
4
|
+
"creationTimestamp":"2013-01-28 18:48:36 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/firewalls/mock-firewall",
|
6
|
+
"name":"mock-firewall",
|
7
|
+
"description":"",
|
8
|
+
"network":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/networks/mock-network",
|
9
|
+
"sourceRanges":["10.10.12.0/24"],
|
10
|
+
"sourceTags":["all"],
|
11
|
+
"targetTags":["all"],
|
12
|
+
"allowed":[{"IPProtocol":"udp","ports":["53"]}]
|
13
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#operation",
|
3
|
+
"id":"10333333339017",
|
4
|
+
"creationTimestamp":"2013-01-24 11:21:00 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/operations/mock-global-operation",
|
6
|
+
"name":"mock-global-operation",
|
7
|
+
"targetLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/networks/mock-network",
|
8
|
+
"targetId":"12991111436062",
|
9
|
+
"clientOperationId":"",
|
10
|
+
"status":"DONE",
|
11
|
+
"statusMessage":"",
|
12
|
+
"user":"mock@example.com",
|
13
|
+
"progress":"100",
|
14
|
+
"insertTime":"2013-01-24 11:21:00 -0800",
|
15
|
+
"startTime":"2013-01-24 11:21:00 -0800",
|
16
|
+
"endTime":"2013-01-24 11:21:12 -0800",
|
17
|
+
"httpErrorStatusCode":"",
|
18
|
+
"httpErrorMessage":"",
|
19
|
+
"error":{
|
20
|
+
"errors":[{
|
21
|
+
"code":"",
|
22
|
+
"location":"",
|
23
|
+
"message":""
|
24
|
+
}]
|
25
|
+
},
|
26
|
+
"warnings":[{
|
27
|
+
"code":"",
|
28
|
+
"data":[{
|
29
|
+
"key":"",
|
30
|
+
"value":""
|
31
|
+
}],
|
32
|
+
"message":""
|
33
|
+
}],
|
34
|
+
"operationType":"addDisk",
|
35
|
+
"zone":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone"
|
36
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#image",
|
3
|
+
"id":"129434444445535318",
|
4
|
+
"creationTimestamp":"2012-07-16 15:16:13 -0700",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/images/mock-image",
|
6
|
+
"name":"mock-image",
|
7
|
+
"description":" CentOS 6.2 image",
|
8
|
+
"sourceType":"RAW",
|
9
|
+
"preferredKernel":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/kernels/mock-kernel",
|
10
|
+
"rawDisk":{"source":"","containerType":"TAR","sha1Checksum":""},
|
11
|
+
"deprecated":{"state":"","replacement":"","deprecated":"","obsolete":"","deleted":""}
|
12
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#kernel",
|
3
|
+
"id":"12941177846308850718",
|
4
|
+
"creationTimestamp":"2012-07-16 14:42:16 -0700",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/kernels/mock-kernel",
|
6
|
+
"name":"mock-kernel",
|
7
|
+
"description":"Mock description",
|
8
|
+
"deprecated":{
|
9
|
+
"state":"",
|
10
|
+
"replacement":"",
|
11
|
+
"deprecated":"",
|
12
|
+
"obsolete":"",
|
13
|
+
"deleted":""
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#machineType",
|
3
|
+
"id":"130222222225",
|
4
|
+
"creationTimestamp":"2012-11-16 11:46:10 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/machineTypes/mock-machine-type",
|
6
|
+
"name":"mock-machine-type",
|
7
|
+
"description":"2 vCPUS, 1.8 GB RAM, and a 10 GB ephemeral root disk",
|
8
|
+
"guestCpus":"2",
|
9
|
+
"memoryMb":"1843",
|
10
|
+
"imageSpaceGb":"10",
|
11
|
+
"ephemeralDisks":[{
|
12
|
+
"diskGb":"1"
|
13
|
+
}],
|
14
|
+
"maximumPersistentDisks":"16",
|
15
|
+
"maximumPersistentDisksSizeGb":"256",
|
16
|
+
"availableZone":[""],
|
17
|
+
"deprecated":{
|
18
|
+
"state":"",
|
19
|
+
"replacement":"",
|
20
|
+
"deprecated":"",
|
21
|
+
"obsolete":"",
|
22
|
+
"deleted":""
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#network",
|
3
|
+
"id":"444444233333",
|
4
|
+
"creationTimestamp":"2013-01-24 23:46:54 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/networks/mock-network",
|
6
|
+
"name":"mock-network",
|
7
|
+
"description":"",
|
8
|
+
"ipV4Range":"10.12.0.0/16",
|
9
|
+
"gatewayIpv4":"10.12.0.1"
|
10
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#project",
|
3
|
+
"id":"129922222222222",
|
4
|
+
"creationTimestamp":"2012-09-13 18:33:49 -0700",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project",
|
6
|
+
"name":"mock-project",
|
7
|
+
"description":"",
|
8
|
+
"commonInstanceMetadata":{
|
9
|
+
"kind":"compute#metadata",
|
10
|
+
"items":[{"key":"mock-key","value":"mock-value"}]
|
11
|
+
},
|
12
|
+
"quotas":[
|
13
|
+
{"metric":"INSTANCES","usage":10.0,"limit":20.0},
|
14
|
+
{"metric":"CPUS","usage":40.0,"limit":96.0},
|
15
|
+
{"metric":"EPHEMERAL_ADDRESSES","usage":10.0,"limit":20.0},
|
16
|
+
{"metric":"DISKS","usage":8.0,"limit":20.0},
|
17
|
+
{"metric":"DISKS_TOTAL_GB","usage":2.0,"limit":40.0},
|
18
|
+
{"metric":"FIREWALLS","usage":10.0,"limit":100.0},
|
19
|
+
{"metric":"IMAGES","usage":0.0,"limit":100.0}],
|
20
|
+
"externalIpAddresses":["4.4.4.4"]
|
21
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#serialPortOutput",
|
3
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone/instances/mock-instance/serialPort",
|
4
|
+
"contents":"\r\nDecompressing Linux... Parsing ELF... done.\r\nBooting the kernel.\r\n[ 0.000000] Initializing cgroup subsys cpuset\r\n[ 0.000000] Initializing cgroup subsys cpu\r\n[ 0.000000] Linux version 2.6.39-gcg-201209041350 (nobody@google.com) (gcc version 4.4.3 (Google_crosstoolv14-gcc-4.4.3-glibc-2.11.1-grte) ) #1 SMP Tue Sep 4 13:53:02 PDT 2012\r\n[ 0.000000] Command line: earlyprintk=ttyS0 loglevel=8 elevator=noop root=/dev/vda1\r\n[ 0.000000] KERNEL supported cpus:\r\n[ 0.000000] Intel GenuineIntel\r\n[ 0.000000] AMD AuthenticAMD\r\n[ 0.000000] BIOS-provided physical RAM map:\r\n[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009cc00 (usable)\r\n[ 0.000000] BIOS-e820: 000000000009cc00 - 00000000000a0000 (reserved)\r\n[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)\r\n[ 0.000000] BIOS-e820: 0000000000100000 - 00000000bfffd000 (usable)\r\n[ 0.000000] BIOS-e820: 00000000bfffd000 - 00000000c0000000 (reserved)\r\n[ 0.000000] BIOS-e820: 00000000fffbc000 - 0000000100000000 (reserved)\r\n[ 0.000000] BIOS-e820: 0000000100000000 - 0000000130000000 (usable)\r\n[ 0.000000] bootconsole [earlyser0] enabled\r\n[ 0.000000] NX (Execute Disable) protection: active\r\n[ 0.000000] DMI 2.4 present.\r\n[ 0.000000] DMI: Google Google, BIOS Google 01/01/2007\r\n[ 0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)\r\n[ 0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)\r\n[ 0.000000] last_pfn = 0x130000 max_arch_pfn = 0x400000000\r\n[ 0.000000] last_pfn = 0xbfffd max_arch_pfn = 0x400000000\r\n[ 0.000000] found SMP MP-table at [ffff8800000fda80] fda80\r\n[ 0.000000] initial memory mapped : 0 - 20000000\r\n[ 0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 8192\r\n[ 0.000000] Using GB pages for direct mapping\r\n[ 0.000000] init_memory_mapping: 0000000000000000-00000000bfffd000\r\n[ 0.000000] 0000000000 - 0080000000 page 1G\r\n[ 0.000000] 0080000000 - 00bfe00000 page 2M\r\n[ 0.000000] 00bfe00000 - 00bfffd000 page 4k\r\n[ 0.000000] kernel direct mapping tables up to bfffd000 @ bfffa000-bfffd000\r\n[ 0.000000] init_memory_mapping: 0000000100000000-0000000130000000\r\n[ 0.000000] 0100000000 - 0130000000 page 2M\r\n[ 0.000000] kernel direct mapping tables up to 130000000 @ 12fffe000-130000000\r\n[ 0.000000] ACPI: RSDP 00000000000fd8f0 00014 (v00 Google)\r\n[ 0.000000] ACPI: RSDT 00000000bfffd840 00030 (v01 Google GOOGRSDT 00000001 GOOG 00000001)\r\n[ 0.000000] ACPI: FACP 00000000bfffff80 00074 (v01 Google GOOGFACP 00000001 GOOG 00000001)\r\n[ 0.000000] ACPI: DSDT 00000000bfffd9f0 0254B (v01 BXPC BXDSDT 00000001 INTL 20090521)\r\n[ 0.000000] ACPI: FACS 00000000bfffff40 00040\r\n[ 0.000000] ACPI: SSDT 00000000bfffd950 0009E (v01 Google GOOGSSDT 00000001 GOOG 00000001)\r\n[ 0.000000] ACPI: APIC 00000000bfffd870 00068 (v01 Google GOOGAPIC 00000001 GOOG 00000001)\r\n[ 0.000000] ACPI: Local APIC address 0xfee00000\r\n[ 0.000000] kvm-clock: Using msrs 12 and 11\r\n[ 0.000000] kvm-clock: cpu 0, msr 0:1acec01, boot clock\r\n[2240221.965990] [ffffea0000000000-ffffea00043fffff] PMD -> [ffff880120400000-ffff8801239fffff] on node 0\r\n[2240221.967196] Zone PFN ranges:\r\n[2240221.967625] DMA 0x00000010 -> 0x00001000\r\n[2240221.968057] DMA32 0x00001000 -> 0x00100000\r\n[2240221.968483] Normal 0x00100000 -> 0x00130000\r\n[2240221.968903] Movable zone start PFN for each node\r\n[2240221.969384] early_node_map[3] active PFN ranges\r\n[2240221.969813] 0: 0x00000010 -> 0x0000009c\r\n[2240221.970218] 0: 0x00000100 -> 0x000bfffd\r\n[2240221.970618] 0: 0x00100000 -> 0x00130000\r\n[2240221.971004] On node 0 totalpages: 982921\r\n[2240221.971385] DMA zone: 56 pages used for memmap\r\n[2240221.971836] DMA zone: 2 pages reserved\r\n[2240221.972197] DMA zone: 3922 pages, LIFO batch:0\r\n[2240221.972712] DMA32 zone: 14280 pages used for memmap\r\n[2240221.973177] DMA32 zone: 768053 pages, LIFO batch:31\r\n[2240221.985831] Normal zone: 2688 pages used for memmap\r\n[2240221.986363] Normal zone: 193920 pages, LIFO batch:31\r\n[2240221.990286] ACPI: Local APIC address 0xfee00000\r\n[2240221.990742] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)\r\n[2240221.991291] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])\r\n[2240221.991932] IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23\r\n[2240221.992566] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)\r\n[2240221.993166] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)\r\n[2240221.993778] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)\r\n[2240221.994435] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)\r\n[2240221.995059] ACPI: IRQ5 used by override.\r\n[2240221.995471] ACPI: IRQ9 used by override.\r\n[2240221.995837] ACPI: IRQ10 used by override.\r\n[2240221.996205] ACPI: IRQ11 used by override.\r\n[2240221.996646] Using ACPI (MADT) for SMP configuration information\r\n[2240221.997186] SMP: Allowing 1 CPUs, 0 hotplug CPUs\r\n[2240221.997617] nr_irqs_gsi: 40\r\n[2240221.997903] Allocating PCI resources starting at c0000000 (gap: c0000000:3ffbc000)\r\n[2240221.998595] Booting paravirtualized kernel on KVM\r\n[2240221.999046] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:1 nr_node_ids:1\r\n[2240222.000139] PERCPU: Embedded 24 pages/cpu @ffff88012fc00000 s75776 r0 d22528 u2097152\r\n[2240222.000948] pcpu-alloc: s75776 r0 d22528 u2097152 alloc=1*2097152\r\n[2240222.001611] pcpu-alloc: [0] 0 \r\n[2240222.001907] kvm-clock: cpu 0, msr 1:2fc11c01, primary cpu clock\r\n[2240222.002455] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 965895\r\n[2240222.003201] Kernel command line: console=ttyS0 reboot=p pci=lastbus=0 iommu=off drop_capabilities=CAP_SYS_RAWIO,CAP_SYS_MODULE earlyprintk=ttyS0 loglevel=8 elevator=noop root=/dev/vda1\r\n[2240222.004769] PID hash table entries: 4096 (order: 3, 32768 bytes)\r\n[2240222.005848] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)\r\n[2240222.007284] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)\r\n[2240222.008488] modelock cap CR0:0x80000001\r\n[2240222.008841] modelock cap CR4:0x30\r\n[2240222.009153] modelock cap EFER:0x100\r\n[2240222.009528] Modelock enabled\r\n[2240222.019326] Memory: 3857624k/4980736k available (6922k kernel code, 1049052k absent, 74060k reserved, 4066k data, 696k init)\r\n[2240222.020563] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1\r\n[2240222.021414] Hierarchical RCU implementation.\r\n[2240222.021827] \tRCU-based detection of stalled CPUs is disabled.\r\n[2240222.022353] NR_IRQS:1280\r\n[2240222.025154] Console: colour dummy device 80x25\r\n[2240222.025611] console [ttyS0] enabled, bootconsole disabled\r\n[2240222.025611] console [ttyS0] enabled, bootconsole disabled\r\n[2240222.036865] Detected 2599.996 MHz processor.\r\n[2240222.037278] Calibrating delay loop (skipped) preset value.. 5199.99 BogoMIPS (lpj=25999960)\r\n[2240222.038078] pid_max: default: 32768 minimum: 301\r\n[2240222.038557] Security Framework initialized\r\n[2240222.038961] AppArmor: AppArmor initialized\r\n[2240222.039383] Mount-cache hash table entries: 256\r\n[2240222.040077] Initializing cgroup subsys ns\r\n[2240222.040498] ns_cgroup deprecated: consider using the 'clone_children' flag without the ns_cgroup.\r\n[2240222.041547] Initializing cgroup subsys cpuacct\r\n[2240222.042319] CPU: Physical Processor ID: 0\r\n[2240222.042786] CPU: Processor Core ID: 0\r\n[2240222.043151] mce: CPU supports 32 MCE banks\r\n[2240222.043946] SMP alternatives: switching to UP code\r\n[2240222.074498] Freeing SMP alternatives: 36k freed\r\n[2240222.074959] ACPI: Core revision 20110316\r\n[2240222.076089] Setting APIC routing to flat\r\n[2240222.077424] ..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1\r\n[2240222.077990] CPU0: Intel(R) Xeon(R) CPU @ 2.60GHz stepping 07\r\n[2240222.316723] Performance Events: unsupported p6 CPU model 45 no PMU driver, software events only.\r\n[2240222.317750] NMI watchdog disabled (cpu0): hardware events not enabled\r\n[2240222.318412] Brought up 1 CPUs\r\n[2240222.318708] Total of 1 processors activated (5199.99 BogoMIPS).\r\n[2240222.319573] devtmpfs: initialized\r\n[2240222.320162] xor: automatically using best checksumming function: generic_sse\r\n[2240222.366731] generic_sse: 5562.000 MB/sec\r\n[2240222.367168] xor: using function: generic_sse (5562.000 MB/sec)\r\n[2240222.367794] NET: Registered protocol family 16\r\n[2240222.368431] ACPI: bus type pci registered\r\n[2240222.368871] PCI: Using configuration type 1 for base access\r\n[2240222.374210] bio: create slab <bio-0> at 0\r\n[2240222.536791] raid6: int64x1 3067 MB/s\r\n[2240222.706768] raid6: int64x2 2875 MB/s\r\n[2240222.876759] raid6: int64x4 2698 MB/s\r\n[2240223.046778] raid6: int64x8 2973 MB/s\r\n[2240223.216746] raid6: sse2x1 7983 MB/s\r\n[2240223.386751] raid6: sse2x2 6871 MB/s\r\n[2240223.556751] raid6: sse2x4 11272 MB/s\r\n[2240223.557151] raid6: using algorithm sse2x4 (11272 MB/s)\r\n[2240223.558118] ACPI: EC: Look up EC in DSDT\r\n[2240223.559656] ACPI: Interpreter enabled\r\n[2240223.560019] ACPI: (supports S0 S5)\r\n[2240223.560380] ACPI: Using IOAPIC for interrupt routing\r\n[2240223.565290] PCI: Ignoring host bridge windows from ACPI; if necessary, use \"pci=use_crs\" and report a bug\r\n[2240223.566191] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])\r\n[2240223.567386] pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7] (ignored)\r\n[2240223.568116] pci_root PNP0A03:00: host bridge window [io 0x0d00-0xffff] (ignored)\r\n[2240223.568838] pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)\r\n[2240223.569624] pci_root PNP0A03:00: host bridge window [mem 0xe0000000-0xfebfffff] (ignored)\r\n[2240223.570440] pci 0000:00:01.0: [8086:7110] type 0 class 0x000601\r\n[2240223.572067] pci 0000:00:01.3: [8086:7113] type 0 class 0x000680\r\n[2240223.573642] pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI\r\n[2240223.574473] pci 0000:00:03.0: [1af4:1001] type 0 class 0x000100\r\n[2240223.575296] pci 0000:00:03.0: reg 10: [io 0xd000-0xd03f]\r\n[2240223.576677] pci 0000:00:04.0: [1af4:1000] type 0 class 0x000200\r\n[2240223.577562] pci 0000:00:04.0: reg 10: [io 0xd040-0xd07f]\r\n[2240223.579029] pci 0000:00:05.0: [1ae0:6442] type 0 class 0x008007\r\n[2240223.579843] pci 0000:00:05.0: reg 10: [io 0xc000-0xcfff]\r\n[2240223.581336] pci_bus 0000:00: on NUMA node 0\r\n[2240223.581737] ACPI: PCI Interrupt Routing Table [\\_SB_.PCI0._PRT]\r\n[2240223.583951] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)\r\n[2240223.584633] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)\r\n[2240223.585284] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)\r\n[2240223.585921] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)\r\n[2240223.586619] ACPI: PCI Interrupt Link [LNKS] (IRQs 9) *0\r\n[2240223.587495] SCSI subsystem initialized\r\n[2240223.588007] PCI: Using ACPI for IRQ routing\r\n[2240223.588509] PCI: pci_cache_line_size set to 64 bytes\r\n[2240223.589074] reserve RAM buffer: 000000000009cc00 - 000000000009ffff \r\n[2240223.589684] reserve RAM buffer: 00000000bfffd000 - 00000000bfffffff \r\n[2240223.590402] Switching to clocksource kvm-clock\r\n[2240223.590924] AppArmor: AppArmor Filesystem Enabled\r\n[2240223.591400] pnp: PnP ACPI init\r\n[2240223.591710] ACPI: bus type pnp registered\r\n[2240223.592108] pnp 00:00: [bus 00-ff]\r\n[2240223.592442] pnp 00:00: [io 0x0cf8-0x0cff]\r\n[2240223.592835] pnp 00:00: [io 0x0000-0x0cf7 window]\r\n[2240223.593287] pnp 00:00: [io 0x0d00-0xffff window]\r\n[2240223.593763] pnp 00:00: [mem 0x000a0000-0x000bffff window]\r\n[2240223.594269] pnp 00:00: [mem 0xe0000000-0xfebfffff window]\r\n[2240223.594810] pnp 00:00: Plug and Play ACPI device, IDs PNP0a03 (active)\r\n[2240223.595453] pnp 00:01: [io 0x0070-0x0071]\r\n[2240223.595864] pnp 00:01: [irq 8]\r\n[2240223.596174] pnp 00:01: [io 0x0072-0x0077]\r\n[2240223.596599] pnp 00:01: Plug and Play ACPI device, IDs PNP0b00 (active)\r\n[2240223.597233] Switched to NOHz mode on CPU #0\r\n[2240223.597675] pnp 00:02: [io 0x0060]\r\n[2240223.598026] pnp 00:02: [io 0x0064]\r\n[2240223.598390] pnp 00:02: [irq 1]\r\n[2240223.598754] pnp 00:02: Plug and Play ACPI device, IDs PNP0303 (active)\r\n[2240223.599485] pnp 00:03: [irq 12]\r\n[2240223.599827] pnp 00:03: Plug and Play ACPI device, IDs PNP0f13 (active)\r\n[2240223.600463] pnp 00:04: [io 0x03f2-0x03f5]\r\n[2240223.600936] pnp 00:04: [io 0x03f7]\r\n[2240223.601294] pnp 00:04: [irq 6]\r\n[2240223.601612] pnp 00:04: [dma 2]\r\n[2240223.601951] pnp 00:04: Plug and Play ACPI device, IDs PNP0700 (active)\r\n[2240223.602637] pnp 00:05: [io 0x03f8-0x03ff]\r\n[2240223.603041] pnp 00:05: [irq 4]\r\n[2240223.603375] pnp 00:05: Plug and Play ACPI device, IDs PNP0501 (active)\r\n[2240223.604074] pnp 00:06: [io 0x02f8-0x02ff]\r\n[2240223.604496] pnp 00:06: [irq 3]\r\n[2240223.604825] pnp 00:06: Plug and Play ACPI device, IDs PNP0501 (active)\r\n[2240223.605665] pnp: PnP ACPI: found 7 devices\r\n[2240223.606056] ACPI: ACPI bus type pnp unregistered\r\n[2240223.608089] pci_bus 0000:00: resource 0 [io 0x0000-0xffff]\r\n[2240223.608659] pci_bus 0000:00: resource 1 [mem 0x00000000-0x3fffffffffff]\r\n[2240223.609318] NET: Registered protocol family 2\r\n[2240223.609776] IP route cache hash table entries: 131072 (order: 8, 1048576 bytes)\r\n[2240223.611969] TCP established hash table entries: 262144 (order: 10, 4194304 bytes)\r\n[2240223.618329] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)\r\n[2240223.620757] TCP: Hash tables configured (established 262144 bind 65536)\r\n[2240223.621607] TCP reno registered\r\n[2240223.621916] UDP hash table entries: 2048 (order: 4, 65536 bytes)\r\n[2240223.622539] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)\r\n[2240223.623239] NET: Registered protocol family 1\r\n[2240223.623827] RPC: Registered udp transport module.\r\n[2240223.624282] RPC: Registered tcp transport module.\r\n[2240223.624723] RPC: Registered tcp NFSv4.1 backchannel transport module.\r\n[2240223.625364] PCI: CLS 0 bytes, default 64\r\n[2240223.628426] audit: initializing netlink socket (disabled)\r\n[2240223.629000] type=2000 audit(1352750868.480:1): initialized\r\n[2240223.632515] nfs4filelayout_init: NFSv4 File Layout Driver Registering...\r\n[2240223.633165] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\r\n[2240223.634045] fuse init (API version 7.16)\r\n[2240223.634526] Installing v9fs 9p2000 file system support\r\n[2240223.635229] Btrfs loaded\r\n[2240223.635492] msgmni has been set to 7534\r\n[2240223.636202] alg: No test for stdrng (krng)\r\n[2240223.639427] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)\r\n[2240223.640070] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)\r\n[2240223.640765] io scheduler noop registered (default)\r\n[2240223.641237] io scheduler deadline registered\r\n[2240223.641689] io scheduler cfq registered\r\n[2240223.642116] pci_hotplug: PCI Hot Plug PCI Core version: 0.5\r\n[2240223.642663] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5\r\n[2240223.643419] acpiphp: Slot [1] registered\r\n[2240223.643873] acpiphp: Slot [2] registered\r\n[2240223.644286] acpiphp: Slot [3] registered\r\n[2240223.644717] acpiphp: Slot [4] registered\r\n[2240223.645129] acpiphp: Slot [5] registered\r\n[2240223.645557] acpiphp: Slot [6] registered\r\n[2240223.645966] acpiphp: Slot [7] registered\r\n[2240223.646396] acpiphp: Slot [8] registered\r\n[2240223.646799] acpiphp: Slot [9] registered\r\n[2240223.647203] acpiphp: Slot [10] registered\r\n[2240223.647617] acpiphp: Slot [11] registered\r\n[2240223.648061] acpiphp: Slot [12] registered\r\n[2240223.648479] acpiphp: Slot [13] registered\r\n[2240223.648930] acpiphp: Slot [14] registered\r\n[2240223.649385] acpiphp: Slot [15] registered\r\n[2240223.649795] acpiphp: Slot [16] registered\r\n[2240223.650246] acpiphp: Slot [17] registered\r\n[2240223.650676] acpiphp: Slot [18] registered\r\n[2240223.651236] acpiphp: Slot [19] registered\r\n[2240223.651663] acpiphp: Slot [20] registered\r\n[2240223.652102] acpiphp: Slot [21] registered\r\n[2240223.652545] acpiphp: Slot [22] registered\r\n[2240223.652958] acpiphp: Slot [23] registered\r\n[2240223.653442] acpiphp: Slot [24] registered\r\n[2240223.653895] acpiphp: Slot [25] registered\r\n[2240223.654386] acpiphp: Slot [26] registered\r\n[2240223.654802] acpiphp: Slot [27] registered\r\n[2240223.655231] acpiphp: Slot [28] registered\r\n[2240223.655646] acpiphp: Slot [29] registered\r\n[2240223.656063] acpiphp: Slot [30] registered\r\n[2240223.656483] acpiphp: Slot [31] registered\r\n[2240223.657476] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0\r\n[2240223.658183] ACPI: Power Button [PWRF]\r\n[2240223.658580] ACPI: acpi_idle registered with cpuidle\r\n[2240223.659816] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11\r\n[2240223.660387] virtio-pci 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11\r\n[2240223.661315] virtio-pci 0000:00:03.0: setting latency timer to 64\r\n[2240223.662055] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10\r\n[2240223.662617] virtio-pci 0000:00:04.0: PCI INT A -> Link[LNKD] -> GSI 10 (level, high) -> IRQ 10\r\n[2240223.663486] virtio-pci 0000:00:04.0: setting latency timer to 64\r\n[2240223.664817] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled\r\n[2240223.686789] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A\r\n[2240223.708609] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A\r\n[2240223.730595] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A\r\n[2240223.752292] 00:06: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A\r\n[2240223.752964] Non-volatile memory driver v1.3\r\n[2240223.753882] loop: module loaded\r\n[2240223.754354] nbd: registered device at major 43\r\n[2240223.767407] vda: vda1\r\n[2240223.768062] drbd: initialized. Version: 8.3.10 (api:88/proto:86-96)\r\n[2240223.768691] drbd: built-in\r\n[2240223.768960] drbd: registered as block device major 147\r\n[2240223.769451] drbd: minor_table @ 0xffff88012f254900\r\n[2240223.770096] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10\r\n[2240223.770660] gmetrics 0000:00:05.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10\r\n[2240223.771626] gmetrics 0000:00:05.0: setting latency timer to 64\r\n[2240223.772198] gmetrics: Found 43 metrics\r\n[2240223.772777] Registered led device: os_booted\r\n[2240223.773186] gmetrics: Metric: os_booted, triggered: 1\r\n[2240223.773783] Registered led device: vmm_start_to_os_booted_ms\r\n[2240223.774321] gmetrics: Metric: vmm_start_to_os_booted_ms, triggered: 1\r\n[2240223.774994] gmetrics: Metric: node0/zone0/active_anon, triggered: 0\r\n[2240223.775657] gmetrics: Metric: node0/zone0/active_file, triggered: 0\r\n[2240223.776315] gmetrics: Metric: node0/zone0/inactive_anon, triggered: 0\r\n[2240223.777140] gmetrics: Metric: node0/zone0/inactive_file, triggered: 0\r\n[2240223.777872] gmetrics: Metric: node0/zone0/unevictable, triggered: 0\r\n[2240223.778574] gmetrics: Metric: node0/zone0/mlock, triggered: 0\r\n[2240223.779209] gmetrics: Metric: node0/zone0/free_pages, triggered: 0\r\n[2240223.779997] gmetrics: Metric: node0/zone0/file_mapped, triggered: 0\r\n[2240223.780707] gmetrics: Metric: node0/zone0/anon_pages, triggered: 0\r\n[2240223.781427] gmetrics: Metric: node0/zone0/file_pages, triggered: 0\r\n[2240223.782151] gmetrics: Metric: node0/zone0/file_dirty, triggered: 0\r\n[2240223.782859] gmetrics: Metric: node0/zone0/writeback, triggered: 0\r\n[2240223.783539] gmetrics: Metric: node0/zone0/slab_reclaimable, triggered: 0\r\n[2240223.784248] gmetrics: Metric: node0/zone0/slab_unreclaimable, triggered: 0\r\n[2240223.784986] gmetrics: Metric: node0/zone0/pagetable, triggered: 0\r\n[2240223.785666] gmetrics: Metric: node0/zone0/kernel_stack, triggered: 0\r\n[2240223.786338] gmetrics: Metric: node0/zone0/bounce, triggered: 0\r\n[2240223.787027] gmetrics: Metric: node0/zone0/shmem, triggered: 0\r\n[2240223.787650] gmetrics: Metric: node0/zone0/dirtied, triggered: 0\r\n[2240223.788315] gmetrics: Metric: node0/zone0/written, triggered: 0\r\n[2240223.788966] gmetrics: Metric: node0/zone1/active_anon, triggered: 0\r\n[2240223.789729] gmetrics: Metric: node0/zone1/active_file, triggered: 0\r\n[2240223.790407] gmetrics: Metric: node0/zone1/inactive_anon, triggered: 0\r\n[2240223.791212] gmetrics: Metric: node0/zone1/inactive_file, triggered: 0\r\n[2240223.791963] gmetrics: Metric: node0/zone1/unevictable, triggered: 0\r\n[2240223.792628] gmetrics: Metric: node0/zone1/mlock, triggered: 0\r\n[2240223.793239] gmetrics: Metric: node0/zone1/free_pages, triggered: 0\r\n[2240223.793908] gmetrics: Metric: node0/zone1/file_mapped, triggered: 0\r\n[2240223.794569] gmetrics: Metric: node0/zone1/anon_pages, triggered: 0\r\n[2240223.795231] gmetrics: Metric: node0/zone1/file_pages, triggered: 0\r\n[2240223.795910] gmetrics: Metric: node0/zone1/file_dirty, triggered: 0\r\n[2240223.796606] gmetrics: Metric: node0/zone1/writeback, triggered: 0\r\n[2240223.797285] gmetrics: Metric: node0/zone1/slab_reclaimable, triggered: 0\r\n[2240223.797987] gmetrics: Metric: node0/zone1/slab_unreclaimable, triggered: 0\r\n[2240223.798810] gmetrics: Metric: node0/zone1/pagetable, triggered: 0\r\n[2240223.799568] gmetrics: Metric: node0/zone1/kernel_stack, triggered: 0\r\n[2240223.800270] gmetrics: Metric: node0/zone1/bounce, triggered: 0\r\n[2240223.800917] gmetrics: Metric: node0/zone1/shmem, triggered: 0\r\n[2240223.801536] gmetrics: Metric: node0/zone1/dirtied, triggered: 0\r\n[2240223.802257] gmetrics: Metric: node0/zone1/written, triggered: 0\r\n[2240223.802919] Registered led device: os_heartbeat\r\n[2240223.803363] gmetrics: Metric: os_heartbeat, triggered: 1\r\n[2240223.803866] gmetrics: Binding metric node0/zone0/active_anon to 1aaa200 (size 8)\r\n[2240223.804598] gmetrics: Binding metric node0/zone0/active_file to 1aaa210 (size 8)\r\n[2240223.805307] gmetrics: Binding metric node0/zone0/inactive_anon to 1aaa1f8 (size 8)\r\n[2240223.806028] gmetrics: Binding metric node0/zone0/inactive_file to 1aaa208 (size 8)\r\n[2240223.806780] gmetrics: Binding metric node0/zone0/unevictable to 1aaa218 (size 8)\r\n[2240223.807485] gmetrics: Binding metric node0/zone0/mlock to 1aaa220 (size 8)\r\n[2240223.808133] gmetrics: Binding metric node0/zone0/free_pages to 1aaa1f0 (size 8)\r\n[2240223.808825] gmetrics: Binding metric node0/zone0/file_mapped to 1aaa230 (size 8)\r\n[2240223.809614] gmetrics: Binding metric node0/zone0/anon_pages to 1aaa228 (size 8)\r\n[2240223.810312] gmetrics: Binding metric node0/zone0/file_pages to 1aaa238 (size 8)\r\n[2240223.811048] gmetrics: Binding metric node0/zone0/file_dirty to 1aaa240 (size 8)\r\n[2240223.811776] gmetrics: Binding metric node0/zone0/writeback to 1aaa248 (size 8)\r\n[2240223.812465] gmetrics: Binding metric node0/zone0/slab_reclaimable to 1aaa250 (size 8)\r\n[2240223.813215] gmetrics: Binding metric node0/zone0/slab_unreclaimable to 1aaa258 (size 8)\r\n[2240223.813967] gmetrics: Binding metric node0/zone0/pagetable to 1aaa260 (size 8)\r\n[2240223.814736] gmetrics: Binding metric node0/zone0/kernel_stack to 1aaa268 (size 8)\r\n[2240223.815451] gmetrics: Binding metric node0/zone0/bounce to 1aaa278 (size 8)\r\n[2240223.816129] gmetrics: Binding metric node0/zone0/shmem to 1aaa2a0 (size 8)\r\n[2240223.816848] gmetrics: Binding metric node0/zone0/dirtied to 1aaa2a8 (size 8)\r\n[2240223.817528] gmetrics: Binding metric node0/zone0/written to 1aaa2b0 (size 8)\r\n[2240223.818230] gmetrics: Binding metric node0/zone1/active_anon to 1aaa840 (size 8)\r\n[2240223.818924] gmetrics: Binding metric node0/zone1/active_file to 1aaa850 (size 8)\r\n[2240223.819715] gmetrics: Binding metric node0/zone1/inactive_anon to 1aaa838 (size 8)\r\n[2240223.820446] gmetrics: Binding metric node0/zone1/inactive_file to 1aaa848 (size 8)\r\n[2240223.821234] gmetrics: Binding metric node0/zone1/unevictable to 1aaa858 (size 8)\r\n[2240223.821973] gmetrics: Binding metric node0/zone1/mlock to 1aaa860 (size 8)\r\n[2240223.822646] gmetrics: Binding metric node0/zone1/free_pages to 1aaa830 (size 8)\r\n[2240223.823359] gmetrics: Binding metric node0/zone1/file_mapped to 1aaa870 (size 8)\r\n[2240223.824081] gmetrics: Binding metric node0/zone1/anon_pages to 1aaa868 (size 8)\r\n[2240223.824783] gmetrics: Binding metric node0/zone1/file_pages to 1aaa878 (size 8)\r\n[2240223.825488] gmetrics: Binding metric node0/zone1/file_dirty to 1aaa880 (size 8)\r\n[2240223.826190] gmetrics: Binding metric node0/zone1/writeback to 1aaa888 (size 8)\r\n[2240223.826989] gmetrics: Binding metric node0/zone1/slab_reclaimable to 1aaa890 (size 8)\r\n[2240223.827801] gmetrics: Binding metric node0/zone1/slab_unreclaimable to 1aaa898 (size 8)\r\n[2240223.828571] gmetrics: Binding metric node0/zone1/pagetable to 1aaa8a0 (size 8)\r\n[2240223.829363] gmetrics: Binding metric node0/zone1/kernel_stack to 1aaa8a8 (size 8)\r\n[2240223.830077] gmetrics: Binding metric node0/zone1/bounce to 1aaa8b8 (size 8)\r\n[2240223.830750] gmetrics: Binding metric node0/zone1/shmem to 1aaa8e0 (size 8)\r\n[2240223.831443] gmetrics: Binding metric node0/zone1/dirtied to 1aaa8e8 (size 8)\r\n[2240223.832182] gmetrics: Binding metric node0/zone1/written to 1aaa8f0 (size 8)\r\n[2240223.832858] gmetrics: Hardware does not have metric 'node0/zone2/active_anon'\r\n[2240223.833564] gmetrics: Hardware does not have metric 'node0/zone2/active_file'\r\n[2240223.834224] gmetrics: Hardware does not have metric 'node0/zone2/inactive_anon'\r\n[2240223.834925] gmetrics: Hardware does not have metric 'node0/zone2/inactive_file'\r\n[2240223.835628] gmetrics: Hardware does not have metric 'node0/zone2/unevictable'\r\n[2240223.836285] gmetrics: Hardware does not have metric 'node0/zone2/mlock'\r\n[2240223.836943] gmetrics: Hardware does not have metric 'node0/zone2/free_pages'\r\n[2240223.837597] gmetrics: Hardware does not have metric 'node0/zone2/file_mapped'\r\n[2240223.838257] gmetrics: Hardware does not have metric 'node0/zone2/anon_pages'\r\n[2240223.838930] gmetrics: Hardware does not have metric 'node0/zone2/file_pages'\r\n[2240223.839677] gmetrics: Hardware does not have metric 'node0/zone2/file_dirty'\r\n[2240223.840337] gmetrics: Hardware does not have metric 'node0/zone2/writeback'\r\n[2240223.841016] gmetrics: Hardware does not have metric 'node0/zone2/slab_reclaimable'\r\n[2240223.841725] gmetrics: Hardware does not have metric 'node0/zone2/slab_unreclaimable'\r\n[2240223.842471] gmetrics: Hardware does not have metric 'node0/zone2/pagetable'\r\n[2240223.843131] gmetrics: Hardware does not have metric 'node0/zone2/kernel_stack'\r\n[2240223.843810] gmetrics: Hardware does not have metric 'node0/zone2/bounce'\r\n[2240223.844431] gmetrics: Hardware does not have metric 'node0/zone2/shmem'\r\n[2240223.845092] gmetrics: Hardware does not have metric 'node0/zone2/dirtied'\r\n[2240223.845738] gmetrics: Hardware does not have metric 'node0/zone2/written'\r\n[2240223.846542] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI\r\n[2240223.847246] e1000: Copyright (c) 1999-2006 Intel Corporation.\r\n[2240223.847814] sky2: driver version 1.28\r\n[2240223.848206] PPP generic driver version 2.4.2\r\n[2240223.848681] PPP Deflate Compression module registered\r\n[2240223.849157] PPP BSD Compression module registered\r\n[2240223.849752] PPP MPPE Compression module registered\r\n[2240223.850211] NET: Registered protocol family 24\r\n[2240223.850638] tun: Universal TUN/TAP device driver, 1.6\r\n[2240223.851131] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>\r\n[2240223.851796] console [netcon0] enabled\r\n[2240223.852155] netconsole: network logging started\r\n[2240223.869877] rtc_cmos 00:01: RTC can wake from S4\r\n[2240223.870663] rtc_cmos 00:01: rtc core: registered rtc_cmos as rtc0\r\n[2240223.871451] rtc0: alarms up to one day, 114 bytes nvram\r\n[2240223.872090] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.06\r\n[2240223.872696] iTCO_wdt: No device detected.\r\n[2240223.873142] Software Watchdog Timer: 0.07 initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout= 0)\r\n[2240223.874157] md: linear personality registered for level -1\r\n[2240223.874675] md: raid0 personality registered for level 0\r\n[2240223.875168] md: raid1 personality registered for level 1\r\n[2240223.875673] md: raid10 personality registered for level 10\r\n[2240223.876180] md: raid6 personality registered for level 6\r\n[2240223.876677] md: raid5 personality registered for level 5\r\n[2240223.877206] md: raid4 personality registered for level 4\r\n[2240223.877732] md: multipath personality registered for level -4\r\n[2240223.878267] md: faulty personality registered for level -5\r\n[2240223.878907] device-mapper: uevent: version 1.0.3\r\n[2240223.879559] device-mapper: ioctl: 4.20.0-ioctl (2011-02-02) initialised: dm-devel@redhat.com\r\n[2240223.880527] device-mapper: multipath: version 1.3.0 loaded\r\n[2240223.881064] device-mapper: multipath round-robin: version 1.0.0 loaded\r\n[2240223.881695] device-mapper: multipath queue-length: version 0.1.0 loaded\r\n[2240223.882338] device-mapper: multipath service-time: version 0.2.0 loaded\r\n[2240223.883020] cpuidle: using governor ladder\r\n[2240223.883448] cpuidle: using governor menu\r\n[2240223.883874] oprofile: using NMI timer interrupt.\r\n[2240223.884340] pktgen: Packet Generator for packet performance testing. Version: 2.74\r\n[2240223.885064] GACT probability on\r\n[2240223.885384] Mirror/redirect action on\r\n[2240223.885738] Simple TC action Loaded\r\n[2240223.886201] netem: version 1.3\r\n[2240223.886514] u32 classifier\r\n[2240223.886785] Actions configured\r\n[2240223.887149] Netfilter messages via NETLINK v0.30.\r\n[2240223.887607] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)\r\n[2240223.888436] ctnetlink v0.93: registering with nfnetlink.\r\n[2240223.888971] xt_time: kernel timezone is -0000\r\n[2240223.889420] IPVS: Registered protocols (TCP, UDP, AH, ESP)\r\n[2240223.889998] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)\r\n[2240223.890839] IPVS: Creating netns size=1744 id=0\r\n[2240223.891311] IPVS: ipvs loaded.\r\n[2240223.891610] IPVS: [rr] scheduler registered.\r\n[2240223.892049] IPVS: [wrr] scheduler registered.\r\n[2240223.892466] IPVS: [lc] scheduler registered.\r\n[2240223.892867] IPVS: [wlc] scheduler registered.\r\n[2240223.893283] IPVS: [lblc] scheduler registered.\r\n[2240223.893702] IPVS: [lblcr] scheduler registered.\r\n[2240223.894126] IPVS: [dh] scheduler registered.\r\n[2240223.894536] IPVS: [sh] scheduler registered.\r\n[2240223.894935] IPVS: [sed] scheduler registered.\r\n[2240223.895378] IPVS: [nq] scheduler registered.\r\n[2240223.895802] IPVS: ftp: loaded support on port[0] = 21\r\n[2240223.896298] IPv4 over IPv4 tunneling driver\r\n[2240223.896986] ip_tables: (C) 2000-2006 Netfilter Core Team\r\n[2240223.897544] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully\r\n[2240223.898147] arp_tables: (C) 2002 David S. Miller\r\n[2240223.898624] TCP cubic registered\r\n[2240223.898937] TCP highspeed registered\r\n[2240223.899319] TCP hybla registered\r\n[2240223.899646] TCP vegas registered\r\n[2240223.899955] TCP veno registered\r\n[2240223.900348] TCP scalable registered\r\n[2240223.900684] TCP lp registered\r\n[2240223.900995] TCP yeah registered\r\n[2240223.901341] TCP illinois registered\r\n[2240223.901687] Initializing XFRM netlink socket\r\n[2240223.902299] NET: Registered protocol family 10\r\n[2240223.902959] IPv6 over IPv4 tunneling driver\r\n[2240223.903566] NET: Registered protocol family 17\r\n[2240223.904005] NET: Registered protocol family 15\r\n[2240223.904451] L2TP core driver, V2.0\r\n[2240223.904792] PPPoL2TP kernel driver, V2.0\r\n[2240223.905193] Installing 9P2000 support\r\n[2240223.905622] Registering the dns_resolver key type\r\n[2240223.906202] registered taskstats version 1\r\n[2240223.907579] Freeing unused kernel memory: 696k freed\r\n[2240223.909176] Write protecting the kernel read-only data: 10240k\r\n[2240223.913300] Freeing unused kernel memory: 1248k freed\r\n[2240223.915799] Freeing unused kernel memory: 456k freed\r\n[2240223.917968] initramfs(out): Mounting system filesystems for initramfs init.d\r\n[2240223.920847] simple-watchdog(info): started\r\n[2240223.922178] initramfs(out): Umounting system filesystems\r\nIP-Config: no devices to configure\r\n[2240223.924896] md: Autodetecting RAID arrays.\r\n[2240223.926062] md: Scanned 0 and added 0 devices.\r\n[2240223.927355] md: autorun ...\r\n[2240223.928197] md: ... autorun DONE.\r\n[2240223.944856] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: (null)\r\nkinit: Mounted root (ext4 filesystem) readonly.\r\nSetting up for ubuntu root disk:\r\nDropped capability: CAP_SYS_RAWIO\r\nDropped capability: CAP_SYS_MODULE\r\n[2240223.981797] init: Failed to create pty - disabling logging for job\r\n[2240223.982466] init: Temporary process spawn error: No such file or directory\r\n[2240223.984297] init: Failed to create pty - disabling logging for job\r\n[2240223.984923] init: Temporary process spawn error: No such file or directory\r\n[2240223.986874] init: Failed to create pty - disabling logging for job\r\n[2240223.987505] init: Temporary process spawn error: No such file or directory\r\n[2240223.988703] init: Failed to create pty - disabling logging for job\r\n[2240223.989337] init: Temporary process spawn error: No such file or directory\r\n[2240223.999373] init: ureadahead main process (762) terminated with status 5\r\n[2240224.008889] init: Failed to create pty - disabling logging for job\r\n[2240224.010683] init: Temporary process spawn error: No such file or directory\r\n[2240224.014818] init: Failed to create pty - disabling logging for job\r\n[2240224.016616] init: Temporary process spawn error: No such file or directory\r\n[2240224.026944] init: Failed to create pty - disabling logging for job\r\n[2240224.028766] init: Temporary process spawn error: No such file or directory\r\n[2240224.031160] init: Failed to create pty - disabling logging for job\r\n[2240224.033025] init: Temporary process spawn error: No such file or directory\r\n[2240224.036011] init: Failed to create pty - disabling logging for job\r\n[2240224.037745] init: Temporary process spawn error: No such file or directory\r\n[2240224.102720] init: Failed to create pty - disabling logging for job\r\n[2240224.105608] init: Temporary process spawn error: No such file or directory\r\n[2240224.114874] init: Failed to create pty - disabling logging for job\r\n[2240224.116620] init: Temporary process spawn error: No such file or directory\r\n[2240224.122166] init: Failed to create pty - disabling logging for job\r\n[2240224.124077] init: Temporary process spawn error: No such file or directory\r\n[2240224.152545] init: Failed to create pty - disabling logging for job\r\n[2240224.165795] init: Failed to create pty - disabling logging for job\r\n[2240224.171666] init: Failed to create pty - disabling logging for job\r\n[2240224.175455] init: Failed to create pty - disabling logging for job\r\n[2240224.314898] init: Failed to create pty - disabling logging for job\r\nfsck from util-linux 2.20.1\r\n/: clean, 29151/625856 files, 266850/2499840 blocks\r\n[2240224.621130] init: Failed to create pty - disabling logging for job\r\n[2240224.759110] init: Failed to create pty - disabling logging for job\r\n[2240224.771512] init: Failed to create pty - disabling logging for job\r\n[2240224.772727] init: Failed to create pty - disabling logging for job\r\n[2240224.799394] init: Failed to create pty - disabling logging for job\r\n[2240225.135401] init: Failed to create pty - disabling logging for job\r\n[2240225.146403] init: Failed to create pty - disabling logging for job\r\n[2240225.180853] init: Failed to create pty - disabling logging for job\r\n[2240225.196540] init: Failed to create pty - disabling logging for job\r\n[2240226.757366] init: Failed to create pty - disabling logging for job\r\n[2240226.870392] init: Failed to create pty - disabling logging for job\r\n[2240227.268113] init: Failed to create pty - disabling logging for job\r\n[2240227.273413] init: Failed to create pty - disabling logging for job\r\n * Starting AppArmor profiles \u001B[80G Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd\r\n\r\u001B[74G[ OK ]\r\n[2240238.161732] init: Failed to create pty - disabling logging for job\r\n[2240238.577001] init: Failed to create pty - disabling logging for job\r\n * Starting NTP [2240238.982497] init: Failed to create pty - disabling logging for job\r\nserver ntpd \u001B[80G [2240239.198778] init: Failed to create pty - disabling logging for job\r\n[2240239.215569] init: Failed to create pty - disabling logging for job\r\n[2240239.359069] init: Failed to create pty - disabling logging for job\r\n[2240239.550499] init: Failed to create pty - disabling logging for job\r\n[2240239.868653] init: Failed to create pty - disabling logging for job\r\n\r\u001B[74G[ OK ]\r\n[2240239.967443] init: Failed to create pty - disabling logging for job\r\n[2240239.971539] init: Failed to create pty - disabling logging for job\r\n[2240239.974822] init: Failed to create pty - disabling logging for job\r\n * Checking battery state... \u001B[80G grep: /sys/power/state: No such file or directory\r\ngrep: /sys/power/state: No such file or directory\r\ngrep: /sys/power/state: No such file or directory\r\n\r\u001B[74G[ OK ]\r\n[2240240.300895] init: Failed to create pty - disabling logging for job\r\n[2240240.302452] init: Failed to create pty - disabling logging for job\r\n[2240240.304170] init: Failed to create pty - disabling logging for job\r\n[2240240.675930] init: Failed to create pty - disabling logging for job\r\n"
|
5
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#instance",
|
3
|
+
"id":"555555555076205",
|
4
|
+
"creationTimestamp":"2013-01-11 10:01:02 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone/instances/mock-instance",
|
6
|
+
"name":"mock-instance",
|
7
|
+
"description":"",
|
8
|
+
"tags":{"fingerprint":"","items":["all"]},
|
9
|
+
"image":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/images/mock-image",
|
10
|
+
"machineType":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/machineTypes/mock-machine-type",
|
11
|
+
"status":"RUNNING",
|
12
|
+
"statusMessage":"",
|
13
|
+
"zone":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone",
|
14
|
+
"networkInterfaces":[{
|
15
|
+
"name":"nic0",
|
16
|
+
"network":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/networks/mock-network",
|
17
|
+
"networkIP":"10.100.0.10",
|
18
|
+
"accessConfigs":[{
|
19
|
+
"kind":"compute#accessConfig",
|
20
|
+
"name":"External NAT",
|
21
|
+
"type":"ONE_TO_ONE_NAT",
|
22
|
+
"natIP":"11.1.1.11"
|
23
|
+
}]
|
24
|
+
}],
|
25
|
+
"disks":[{
|
26
|
+
"kind":"compute#attachedDisk",
|
27
|
+
"type":"EPHEMERAL",
|
28
|
+
"mode":"READ_WRITE",
|
29
|
+
"source":"",
|
30
|
+
"deviceName":"",
|
31
|
+
"index":"0",
|
32
|
+
"boot":false
|
33
|
+
}],
|
34
|
+
"metadata":{
|
35
|
+
"kind":"compute#metadata",
|
36
|
+
"fingerprint":"",
|
37
|
+
"items":[{
|
38
|
+
"key":"",
|
39
|
+
"value":""
|
40
|
+
}]
|
41
|
+
},
|
42
|
+
"serviceAccounts":[{
|
43
|
+
"email":"",
|
44
|
+
"scopes":[""]
|
45
|
+
}]
|
46
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#snapshot",
|
3
|
+
"id":"12222223333875",
|
4
|
+
"creationTimestamp":"2013-01-28 08:29:58 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/global/snapshots/mock-snapshot",
|
6
|
+
"name":"mock-snapshot",
|
7
|
+
"description":"",
|
8
|
+
"diskSizeGb":"10",
|
9
|
+
"status":"READY",
|
10
|
+
"sourceDisk":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone/disks/mock-disk",
|
11
|
+
"sourceDiskId":"1111222222222018"
|
12
|
+
}
|
data/spec/data/zone.json
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#zone",
|
3
|
+
"id":"130430234345556",
|
4
|
+
"creationTimestamp":"2012-11-15 22:06:55 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone",
|
6
|
+
"name":"mock-zone",
|
7
|
+
"description":"mock-zone",
|
8
|
+
"status":"UP",
|
9
|
+
"maintenanceWindows":[{
|
10
|
+
"name":"2013-03-02-planned-outage",
|
11
|
+
"description":"maintenance zone",
|
12
|
+
"beginTime":"2013-03-02T12:00:00.000-08:00",
|
13
|
+
"endTime":"2013-03-17T13:00:00.000-07:00"}],
|
14
|
+
"availableMachineType":[""],
|
15
|
+
"quotas":[
|
16
|
+
{"metric":"INSTANCES","usage":10.0,"limit":20.0},
|
17
|
+
{"metric":"CPUS","usage":40.0,"limit":96.0},
|
18
|
+
{"metric":"EPHEMERAL_ADDRESSES","usage":10.0,"limit":20.0},
|
19
|
+
{"metric":"DISKS","usage":8.0,"limit":20.0},
|
20
|
+
{"metric":"DISKS_TOTAL_GB","usage":2.0,"limit":40.0},
|
21
|
+
{"metric":"FIREWALLS","usage":10.0,"limit":100.0},
|
22
|
+
{"metric":"IMAGES","usage":0.0,"limit":100.0}],
|
23
|
+
"deprecated":{
|
24
|
+
"state":"",
|
25
|
+
"replacement":"",
|
26
|
+
"deprecated":"",
|
27
|
+
"obsolete":"",
|
28
|
+
"deleted":""
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"kind":"compute#operation",
|
3
|
+
"id":"10333333339018",
|
4
|
+
"creationTimestamp":"2013-01-24 11:21:00 -0800",
|
5
|
+
"selfLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zone/mock-zone/operations/mock-zone-operation",
|
6
|
+
"name":"mock-zone-operation",
|
7
|
+
"targetLink":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone/disks/mock-disk",
|
8
|
+
"targetId":"12991111436063",
|
9
|
+
"clientOperationId":"",
|
10
|
+
"status":"DONE",
|
11
|
+
"statusMessage":"",
|
12
|
+
"user":"mock@example.com",
|
13
|
+
"progress":"100",
|
14
|
+
"insertTime":"2013-01-24 11:21:00 -0800",
|
15
|
+
"startTime":"2013-01-24 11:21:00 -0800",
|
16
|
+
"endTime":"2013-01-24 11:21:12 -0800",
|
17
|
+
"httpErrorStatusCode":"",
|
18
|
+
"httpErrorMessage":"",
|
19
|
+
"error":{
|
20
|
+
"errors":[{
|
21
|
+
"code":"",
|
22
|
+
"location":"",
|
23
|
+
"message":""
|
24
|
+
}]
|
25
|
+
},
|
26
|
+
"warnings":[{
|
27
|
+
"code":"",
|
28
|
+
"data":[{
|
29
|
+
"key":"",
|
30
|
+
"value":""
|
31
|
+
}],
|
32
|
+
"message":""
|
33
|
+
}],
|
34
|
+
"operationType":"insert",
|
35
|
+
"zone":"https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone"
|
36
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Copyright 2013 Google Inc. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
require 'spec_helper'
|
15
|
+
|
16
|
+
describe Google::Compute::Disk do
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
@mock_api_client=mock(Google::APIClient, :authorization= =>{}, :auto_refresh_token= =>{})
|
20
|
+
@mock_api_client.stub!(:discovered_api).and_return(mock_compute)
|
21
|
+
Google::APIClient.stub!(:new).and_return(@mock_api_client)
|
22
|
+
end
|
23
|
+
|
24
|
+
let(:client) do
|
25
|
+
Google::Compute::Client.from_json(mock_data_file(Google::Compute::Client))
|
26
|
+
end
|
27
|
+
|
28
|
+
it_should_behave_like Google::Compute::Resource
|
29
|
+
|
30
|
+
it "#get should return an individual disk by name" do
|
31
|
+
@mock_api_client.should_receive(:execute).
|
32
|
+
with(:api_method=>mock_compute.disks.get,
|
33
|
+
:parameters=>{"disk"=>"mock-disk", :project=>"mock-project", :zone=>"mock-zone"},:body_object=>nil).
|
34
|
+
and_return(mock_response(Google::Compute::Disk))
|
35
|
+
|
36
|
+
disk = client.disks.get(:name=>'mock-disk', :zone=>'mock-zone')
|
37
|
+
disk.should be_a_kind_of Google::Compute::Disk
|
38
|
+
disk.name.should eq('mock-disk')
|
39
|
+
end
|
40
|
+
|
41
|
+
# TODO(erjohnso): come back to this and see about fixing it
|
42
|
+
# it "#get return an individual disk by passing the disk object also" do
|
43
|
+
# @mock_api_client.should_receive(:execute).
|
44
|
+
# with(:api_method=>mock_compute.disks.get,
|
45
|
+
# :parameters=>{"disk"=>"mock-disk", :project=>"mock-project", :zone=>"mock-zone"},:body_object=>nil).
|
46
|
+
# and_return(mock_response(Google::Compute::Disk))
|
47
|
+
#
|
48
|
+
# disk = client.disks.get(:disk=>instance_from_mock_data(Google::Compute::Disk), :zone=>instance_from_mock_data(Google::Compute::Zone))
|
49
|
+
# disk.should be_a_kind_of Google::Compute::Disk
|
50
|
+
# disk.name.should eq('mock-disk')
|
51
|
+
# end
|
52
|
+
|
53
|
+
it "#get should return an individual disk by passing a hash with name key also" do
|
54
|
+
@mock_api_client.should_receive(:execute).
|
55
|
+
with(:api_method=>mock_compute.disks.get,
|
56
|
+
:parameters=>{"disk"=>"mock-disk", :project=>"mock-project", :zone=>"mock-zone"},:body_object=>nil).
|
57
|
+
and_return(mock_response(Google::Compute::Disk))
|
58
|
+
|
59
|
+
disk = client.disks.get(:name=>'mock-disk', :zone=>"mock-zone")
|
60
|
+
disk.should be_a_kind_of Google::Compute::Disk
|
61
|
+
disk.name.should eq('mock-disk')
|
62
|
+
end
|
63
|
+
|
64
|
+
it "#list should return an array of disks" do
|
65
|
+
@mock_api_client.should_receive(:execute).
|
66
|
+
with(:api_method=>mock_compute.disks.list,
|
67
|
+
:parameters=>{ :project=>"mock-project", :zone=>"mock-zone"},:body_object=>nil).
|
68
|
+
and_return(mock_response(Google::Compute::Disk, true))
|
69
|
+
disks = client.disks.list(:zone=>"mock-zone")
|
70
|
+
disks.all?{|disk| disk.is_a?(Google::Compute::Disk)}.should be_true
|
71
|
+
end
|
72
|
+
|
73
|
+
it "#create should create a new disk" do
|
74
|
+
#zone = 'https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone'
|
75
|
+
zone = 'mock-zone'
|
76
|
+
@mock_api_client.should_receive(:execute).
|
77
|
+
with(:api_method=>mock_compute.disks.insert,
|
78
|
+
:parameters=>{ :project=>"mock-project", :zone=>"mock-zone"},
|
79
|
+
:body_object=>{:name=>"xxx", :sizeGb=>2, :zone=>"mock-zone"}).
|
80
|
+
and_return(mock_response(Google::Compute::ZoneOperation))
|
81
|
+
o = client.disks.create(:name=>'xxx', :sizeGb=>2, :zone=>zone)
|
82
|
+
o.should be_a_kind_of Google::Compute::ZoneOperation
|
83
|
+
end
|
84
|
+
|
85
|
+
it "#insert should create a new disk also" do
|
86
|
+
#zone = 'https://www.googleapis.com/compute/v1beta14/projects/mock-project/zones/mock-zone'
|
87
|
+
zone = 'mock-zone'
|
88
|
+
@mock_api_client.should_receive(:execute).
|
89
|
+
with(:api_method=>mock_compute.disks.insert,
|
90
|
+
:parameters=>{ :project=>"mock-project", :zone=>"mock-zone"},
|
91
|
+
:body_object=>{:name=>"xxx", :sizeGb=>2, :zone=>"mock-zone"}).
|
92
|
+
and_return(mock_response(Google::Compute::ZoneOperation))
|
93
|
+
o = client.disks.insert(:name=>'xxx', :sizeGb=>2, :zone=>zone)
|
94
|
+
o.should be_a_kind_of Google::Compute::ZoneOperation
|
95
|
+
end
|
96
|
+
|
97
|
+
it "#delete should delete an existing disk" do
|
98
|
+
@mock_api_client.should_receive(:execute).
|
99
|
+
with(:api_method=>mock_compute.disks.delete,
|
100
|
+
:parameters=>{ :project=>"mock-project",'disk'=>'mock-disk', :zone=>"mock-zone"},:body_object =>nil).
|
101
|
+
and_return(mock_response(Google::Compute::ZoneOperation))
|
102
|
+
o = client.disks.delete("disk"=>'mock-disk', :zone=>'mock-zone')
|
103
|
+
o.should be_a_kind_of Google::Compute::ZoneOperation
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# Copyright 2013 Google Inc. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
#
|
15
|
+
require 'spec_helper'
|
16
|
+
|
17
|
+
describe Google::Compute::Firewall do
|
18
|
+
|
19
|
+
before(:each) do
|
20
|
+
@mock_api_client=mock(Google::APIClient, :authorization= =>{}, :auto_refresh_token= =>{})
|
21
|
+
@mock_api_client.stub!(:discovered_api).and_return(mock_compute)
|
22
|
+
Google::APIClient.stub!(:new).and_return(@mock_api_client)
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:client) do
|
26
|
+
Google::Compute::Client.from_json(mock_data_file(Google::Compute::Client))
|
27
|
+
end
|
28
|
+
|
29
|
+
it_should_behave_like Google::Compute::Resource
|
30
|
+
|
31
|
+
it "#get should return an individual firewall" do
|
32
|
+
@mock_api_client.should_receive(:execute).
|
33
|
+
with(:api_method=>mock_compute.firewalls.get,
|
34
|
+
:parameters=>{"firewall"=>"mock-firewall", :project=>"mock-project"},:body_object=>nil).
|
35
|
+
and_return(mock_response(Google::Compute::Firewall))
|
36
|
+
fw = client.firewalls.get('mock-firewall')
|
37
|
+
fw.should be_a_kind_of Google::Compute::Firewall
|
38
|
+
fw.name.should eq('mock-firewall')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "#list should return an array of firewalls" do
|
42
|
+
@mock_api_client.should_receive(:execute).
|
43
|
+
with(:api_method=>mock_compute.firewalls.list,
|
44
|
+
:parameters=>{:project=>"mock-project"},:body_object=>nil).
|
45
|
+
and_return(mock_response(Google::Compute::Firewall,true))
|
46
|
+
fws = client.firewalls.list
|
47
|
+
fws.should_not be_empty
|
48
|
+
fws.all?{|f| f.is_a?(Google::Compute::Firewall)}.should be_true
|
49
|
+
end
|
50
|
+
|
51
|
+
it "#create should create a new firewall" do
|
52
|
+
network = 'https://www.googleapis.com/compute/v1beta13/projects/mock-project/networks/mock-network'
|
53
|
+
ingress= {'IPProtocol'=>'tcp',"ports"=>["80"]}
|
54
|
+
@mock_api_client.should_receive(:execute).
|
55
|
+
with(:api_method=>mock_compute.firewalls.insert,
|
56
|
+
:parameters=>{:project=>"mock-project"},
|
57
|
+
:body_object=>{:name =>'mock-firewall',
|
58
|
+
:network=>network,
|
59
|
+
:sourceRanges=>['10.12.0.0/24'],
|
60
|
+
:allowed=>[ingress]}).
|
61
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
62
|
+
|
63
|
+
o = client.firewalls.create(:name=>'mock-firewall',
|
64
|
+
:network=>network,
|
65
|
+
:sourceRanges=>['10.12.0.0/24'],
|
66
|
+
:allowed=>[ingress]
|
67
|
+
)
|
68
|
+
o.should be_a_kind_of Google::Compute::GlobalOperation
|
69
|
+
end
|
70
|
+
|
71
|
+
it "#delete should delete an existing firewall" do
|
72
|
+
@mock_api_client.should_receive(:execute).
|
73
|
+
with(:api_method=>mock_compute.firewalls.delete,
|
74
|
+
:parameters=>{:project=>"mock-project",'firewall'=>'mock-firewall'},:body_object=>nil).
|
75
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
76
|
+
o = client.firewalls.delete('mock-firewall')
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "#patch" do
|
80
|
+
|
81
|
+
before(:each) do
|
82
|
+
Google::Compute::Resource.any_instance.stub(:update!)
|
83
|
+
end
|
84
|
+
|
85
|
+
let(:firewall) do
|
86
|
+
Google::Compute::Firewall.new(mock_hash(Google::Compute::Firewall).
|
87
|
+
merge(:dispatcher=>client.dispatcher))
|
88
|
+
end
|
89
|
+
|
90
|
+
it "#source_tags= should update the source tags" do
|
91
|
+
@mock_api_client.should_receive(:execute).
|
92
|
+
with(:api_method=>mock_compute.firewalls.patch,
|
93
|
+
:parameters=>{:project=>"mock-project",:firewall=>'mock-firewall'},
|
94
|
+
:body_object=>{:sourceTags=>["all"], :name=>"mock-firewall", :network=>firewall.network}).
|
95
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
96
|
+
|
97
|
+
firewall.source_tags= ["all"]
|
98
|
+
end
|
99
|
+
|
100
|
+
it "#target_tags= should update the target tags" do
|
101
|
+
@mock_api_client.should_receive(:execute).
|
102
|
+
with(:api_method=>mock_compute.firewalls.patch,
|
103
|
+
:parameters=>{:project=>"mock-project",:firewall=>'mock-firewall'},
|
104
|
+
:body_object=>{:targetTags=>["all"], :name=>"mock-firewall", :network=>firewall.network}).
|
105
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
106
|
+
firewall.target_tags= ["all"]
|
107
|
+
end
|
108
|
+
|
109
|
+
it "#source_ranges= should update the source ranges" do
|
110
|
+
@mock_api_client.should_receive(:execute).
|
111
|
+
with(:api_method=>mock_compute.firewalls.patch,
|
112
|
+
:parameters=>{:project=>"mock-project",:firewall=>'mock-firewall'},
|
113
|
+
:body_object=>{:sourceRanges=>["10.10.12.0/24"], :name=>"mock-firewall", :network=>firewall.network}).
|
114
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
115
|
+
firewall.source_ranges= ["10.10.12.0/24"]
|
116
|
+
end
|
117
|
+
|
118
|
+
it "#allowed= should update the source allowed traffic" do
|
119
|
+
ingress= {'IPProtocol'=>'udp',"ports"=>["53"]}
|
120
|
+
@mock_api_client.should_receive(:execute).
|
121
|
+
with(:api_method=>mock_compute.firewalls.patch,
|
122
|
+
:parameters=>{:project=>"mock-project",:firewall=>'mock-firewall'},
|
123
|
+
:body_object=>{:allowed=>[ingress], :name=>"mock-firewall", :network=>firewall.network}).
|
124
|
+
and_return(mock_response(Google::Compute::GlobalOperation))
|
125
|
+
firewall.allowed= [ingress]
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|