Example #1
0
func TestAvailLinodePlansIntegration(t *testing.T) {
	c := NewClient(apiKey)

	plans, err := c.AvailLinodePlans(nil)
	require.NoError(t, err)
	require.NotEmpty(t, plans)

	testPlanNotEmpty(t, plans)

	// Spot check
	plans, err = c.AvailLinodePlans(Int(1))
	require.NoError(t, err)
	require.Len(t, plans, 1)

	p := plans[0]

	assert.Equal(t, 1, p.Cores)
	assert.Equal(t, 10.00, p.Price)
	assert.Equal(t, 1024, p.RAM)
	assert.Equal(t, 2000, p.Xfer)
	assert.Equal(t, 1, p.ID)
	assert.Equal(t, "Linode 1024", p.Label)
	assert.Equal(t, 24, p.Disk)
	assert.Equal(t, 0.015, p.Hourly)

	plans, err = c.AvailLinodePlans(Int(3498230))
	require.NoError(t, err)
	require.Empty(t, plans)
}
Example #2
0
func TestAvailKernelsOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailKernelsOK()))
	defer ts.Close()

	kerns, err := c.AvailKernels(nil, nil)
	require.NoError(t, err)
	require.Len(t, kerns, 135)

	var sample Kernel
	var everXen bool
	var everPVOps bool

	for _, k := range kerns {
		if k.IsXen {
			everXen = true
		}
		if k.IsPVOps {
			everPVOps = true
		}
		assert.NotEmpty(t, k.Label, "k.Label")
		assert.NotEmpty(t, k.ID, "k.ID")

		if k.ID == 138 {
			sample = k
		}
	}
	assert.True(t, everXen, "everXen")
	assert.True(t, everPVOps, "everPVOps")

	assert.Equal(t, "Latest 64 bit (4.1.0-x86_64-linode59)", sample.Label, "sample.Label")
	assert.True(t, sample.IsXen, "sample.IsXen")
	assert.True(t, sample.IsPVOps, "sample.IsPVOps")
	assert.Equal(t, 138, sample.ID, "sample.ID")
}
Example #3
0
func TestNodeBalancerConfigListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockNodeBalancerConfigListOK()))
	defer ts.Close()

	nbconfs, err := c.NodeBalancerConfigList(13128, Int(14591))
	require.NoError(t, err)
	require.Len(t, nbconfs, 1)

	nbc := nbconfs[0]
	assert.Equal(t, "http_cookie", nbc.Stickiness)
	assert.Equal(t, "", nbc.SSLCommonName)
	assert.Equal(t, "/foo", nbc.CheckPath)
	assert.Equal(t, "bar", nbc.CheckBody)
	assert.Equal(t, 30, nbc.CheckInterval)
	assert.Equal(t, "", nbc.SSLFingerprint)
	assert.Equal(t, "roundrobin", nbc.Algorithm)
	assert.Equal(t, 14591, nbc.ID)
	assert.Equal(t, 15, nbc.CheckAttempts)
	assert.Equal(t, 13128, nbc.NodeBalancerID)
	assert.Equal(t, 80, nbc.Port)
	assert.Equal(t, "http", nbc.Check)
	assert.False(t, nbc.CheckPassive)
	assert.Equal(t, "http", nbc.Protocol)
	assert.Equal(t, 29, nbc.CheckTimeout)
}
Example #4
0
func TestLinodeConfigList(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockLinodeConfigListOK()))
	defer ts.Close()

	confs, err := c.LinodeConfigList(1139016, Int(1855685))
	require.NoError(t, err)
	require.Len(t, confs, 1)

	cfg := confs[0]
	assert.Equal(t, "bar", cfg.RootDeviceCustom)
	assert.Equal(t, "foo", cfg.Comments)
	assert.Equal(t, "test-conf1", cfg.Label)
	assert.Equal(t, 1855685, cfg.ID)
	assert.Equal(t, "3569234,3569220,,,,,,,", cfg.DiskList)
	assert.Equal(t, "default", cfg.RunLevel)
	assert.Equal(t, 1, cfg.RootDeviceNum)
	assert.Equal(t, 800, cfg.RAMLimit)
	assert.Equal(t, "paravirt", cfg.VirtMode)
	assert.Equal(t, 1139016, cfg.LinodeID)
	assert.Equal(t, 138, cfg.KernelID)
	assert.True(t, cfg.DevTmpFSAutomount)
	assert.True(t, cfg.HelperDistro)
	assert.True(t, cfg.HelperDisableUpdateDB)
	assert.True(t, cfg.HelperDepmod)
	assert.True(t, cfg.HelperXen)
	assert.True(t, cfg.RootDeviceRO)
	assert.True(t, cfg.HelperNetwork)
	assert.True(t, cfg.IsRescue)
}
Example #5
0
func TestStackScriptIntegration(t *testing.T) {
	c := NewClient(apiKey)

	ssID, err := c.StackScriptCreate("test", "130,", "#! /bin/bash foo", String("foo"),
		Bool(false), String("bar"))
	require.NoError(t, err)
	require.NotEmpty(t, ssID)

	ssList, err := c.StackScriptList(Int(ssID))
	require.NoError(t, err)
	require.Len(t, ssList, 1)

	ss := ssList[0]
	assert.Equal(t, "bar", ss.RevNote)
	assert.Equal(t, "#! /bin/bash foo", ss.Script)
	assert.Equal(t, "130,", ss.DistIDList)
	assert.Equal(t, "foo", ss.Description)
	assert.NotEmpty(t, ss.RevDT)
	assert.Equal(t, "test", ss.Label)
	assert.Equal(t, 0, ss.TotalDeploys)
	assert.NotEmpty(t, ss.LatestRev)
	assert.Equal(t, ssID, ss.ID)
	assert.False(t, ss.IsPublic)
	assert.Equal(t, 0, ss.ActiveDeploys)
	assert.NotEmpty(t, ss.CreateDT)
	assert.NotEmpty(t, ss.UserID)

	err = c.StackScriptUpdate(ssID, String("test-2"), String("quux"), String("129,130"), Bool(true),
		String("baz"), String("#! /bin/bash baz"))
	require.NoError(t, err)

	ssList, err = c.StackScriptList(Int(ssID))
	require.NoError(t, err)
	require.Len(t, ssList, 1)

	ss = ssList[0]
	assert.Equal(t, "baz", ss.RevNote)
	assert.Equal(t, "#! /bin/bash baz", ss.Script)
	assert.Equal(t, "129,130", ss.DistIDList)
	assert.Equal(t, "quux", ss.Description)
	assert.Equal(t, "test-2", ss.Label)
	assert.Equal(t, ssID, ss.ID)
	assert.True(t, ss.IsPublic)

	err = c.StackScriptDelete(ssID)
	require.NoError(t, err)
}
Example #6
0
func TestImageListPendingOnlyOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockImageListPendingOnlyOK()))
	defer ts.Close()

	imgs, err := c.ImageList(Int(402716), Bool(true))
	require.NoError(t, err)
	require.Len(t, imgs, 0)
}
Example #7
0
func TestAvailKernelsEmpty(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailKernelsEmpty()))
	defer ts.Close()

	kerns, err := c.AvailKernels(Int(4389048234), Bool(false))
	require.NoError(t, err)
	require.Len(t, kerns, 0)
}
Example #8
0
func TestAvailLinodePlansEmpty(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailLinodePlansEmpty()))
	defer ts.Close()

	plans, err := c.AvailLinodePlans(Int(3498230))
	require.NoError(t, err)
	require.Len(t, plans, 0)
}
Example #9
0
func TestAvailKernelsSingle(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailKernelsSingle()))
	defer ts.Close()

	kerns, err := c.AvailKernels(Int(138), Bool(true))
	require.NoError(t, err)
	require.Len(t, kerns, 1)

	k := kerns[0]

	assert.Equal(t, "Latest 64 bit (4.1.0-x86_64-linode59)", k.Label, "k.Label")
	assert.True(t, k.IsXen, "k.IsXen")
	assert.True(t, k.IsPVOps, "k.IsPVOps")
	assert.Equal(t, 138, k.ID, "k.ID")
}
Example #10
0
func TestLinodeIPListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockLinodeIPListOK()))
	defer ts.Close()

	IPList, err := c.LinodeIPList(Int(1146420), Int(1))
	require.NoError(t, err)
	require.Len(t, IPList, 1)

	IP := IPList[0]
	assert.Equal(t, 296963, IP.ID)
	assert.Equal(t, "li959-147.members.linode.com", IP.RDNSName)
	assert.Equal(t, 1146420, IP.LinodeID)
	assert.True(t, IP.IsPublic)
	assert.Equal(t, "45.33.5.147", IP.Address)
}
Example #11
0
func TestAvailDistributionsSingle(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailDistributionsSingle()))
	defer ts.Close()

	dists, err := c.AvailDistributions(Int(130))
	require.NoError(t, err)
	require.Len(t, dists, 1)

	d := dists[0]
	assert.Equal(t, true, d.RequiresPVOps, "d.RequiresPVOps")
	assert.Equal(t, 130, d.ID, "d.ID")
	assert.Equal(t, true, d.Is64Bit, "d.Is64Bit")
	assert.Equal(t, "Debian 7", d.Label, "d.Label")
	assert.Equal(t, 600, d.MinImageSize, "d.MinImageSize")
	assert.Equal(t, "2014-09-24 13:59:32.0", d.CreateDT, "d.CreateDT")
}
Example #12
0
func TestNodeBalancerListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockNodeBalancerListOK()))
	defer ts.Close()

	nbList, err := c.NodeBalancerList(Int(13128))
	require.NoError(t, err)
	require.Len(t, nbList, 1)

	n := nbList[0]
	assert.Equal(t, "nb-198-58-121-23.dallas.nodebalancer.linode.com", n.Hostname)
	assert.Equal(t, "testing", n.Label)
	assert.Equal(t, 5, n.Throttle)
	assert.Equal(t, 2, n.DatacenterID)
	assert.Equal(t, "198.58.121.23", n.IPv4Addr)
	assert.Equal(t, "2600:3c00:1::c63a:7917", n.IPv6Addr)
	assert.Equal(t, 13128, n.ID)
}
Example #13
0
func TestNodeBalancerNodeListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockNodeBalancerNodeListOK()))
	defer ts.Close()

	nbNodes, err := c.NodeBalancerNodeList(14591, Int(140574))
	require.NoError(t, err)
	require.Len(t, nbNodes, 1)

	node := nbNodes[0]
	assert.Equal(t, 50, node.Weight)
	assert.Equal(t, "192.168.202.68:90", node.Address)
	assert.Equal(t, "test", node.Label)
	assert.Equal(t, 140574, node.ID)
	assert.Equal(t, "accept", node.Mode)
	assert.Equal(t, 14591, node.ConfigID)
	assert.Equal(t, "Unknown", node.Status)
	assert.Equal(t, 13128, node.NodeBalancerID)
}
Example #14
0
func TestAvailLinodePlansSingle(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailLinodePlansSingle()))
	defer ts.Close()

	plans, err := c.AvailLinodePlans(Int(1))
	require.NoError(t, err)
	require.Len(t, plans, 1)

	p := plans[0]

	assert.Equal(t, 1, p.Cores)
	assert.Equal(t, 10.00, p.Price)
	assert.Equal(t, 1024, p.RAM)
	assert.Equal(t, 2000, p.Xfer)
	assert.Equal(t, 1, p.ID)
	assert.Equal(t, "Linode 1024", p.Label)
	assert.Equal(t, 24, p.Disk)
	assert.Equal(t, 0.015, p.Hourly)
}
Example #15
0
func TestDomainResourceListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockDomainResourceListOK()))
	defer ts.Close()

	resources, err := c.DomainResourceList(716074, Int(5337468))
	require.NoError(t, err)
	require.Len(t, resources, 1)
	r := resources[0]

	assert.Equal(t, 716074, r.DomainID)
	assert.Equal(t, 15, r.Port)
	assert.Equal(t, 5337468, r.ID)
	assert.Equal(t, "_foo._tcp", r.Name)
	assert.Equal(t, 10, r.Weight)
	assert.Equal(t, 300, r.TTLSec)
	assert.Equal(t, "bar.baz.com", r.Target)
	assert.Equal(t, 5, r.Priority)
	assert.Equal(t, "tcp", r.Protocol)
	assert.Equal(t, "srv", r.Type)
}
Example #16
0
func TestImageListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockImageListOK()))
	defer ts.Close()

	imgs, err := c.ImageList(Int(402716), Bool(false))
	require.NoError(t, err)
	require.Len(t, imgs, 1)

	i := imgs[0]
	assert.Equal(t, "baz", i.LastUsedDT)
	assert.Equal(t, 600, i.MinSize)
	assert.Equal(t, "foo", i.Description)
	assert.Equal(t, "bar", i.Label)
	assert.Equal(t, "quux", i.Creator)
	assert.Equal(t, "available", i.Status)
	assert.True(t, i.IsPublic)
	assert.Equal(t, "2015-07-07 23:55:59.0", i.CreateDT)
	assert.Equal(t, "manual", i.Type)
	assert.Equal(t, "ext4", i.FSType)
	assert.Equal(t, 402716, i.ID)
}
Example #17
0
func TestStackScriptListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockStackScriptListOK()))
	defer ts.Close()

	ssList, err := c.StackScriptList(Int(12567))
	require.NoError(t, err)
	require.Len(t, ssList, 1)

	ss := ssList[0]
	assert.Equal(t, "bar", ss.RevNote)
	assert.Equal(t, "#! /bin/bash foo", ss.Script)
	assert.Equal(t, "130,", ss.DistIDList)
	assert.Equal(t, "2015-07-08 23:46:50.0", ss.RevDT)
	assert.Equal(t, "test", ss.Label)
	assert.Equal(t, 1, ss.TotalDeploys)
	assert.Equal(t, 60999, ss.LatestRev)
	assert.Equal(t, 12567, ss.ID)
	assert.True(t, ss.IsPublic)
	assert.Equal(t, 2, ss.ActiveDeploys)
	assert.Equal(t, "2015-07-08 23:46:50.0", ss.CreateDT)
	assert.Equal(t, 1337, ss.UserID)
}
Example #18
0
func TestAvailKernelsIntegration(t *testing.T) {
	c := NewClient(apiKey)

	kerns, err := c.AvailKernels(nil, nil)
	require.NoError(t, err)
	require.NotEmpty(t, kerns)

	var everXen bool
	var everPVOps bool

	for _, k := range kerns {
		if k.IsXen {
			everXen = true
		}
		if k.IsPVOps {
			everPVOps = true
		}
		assert.NotEmpty(t, k.Label, "k.Label")
		assert.NotEmpty(t, k.ID, "k.ID")
	}
	assert.True(t, everXen, "everXen")
	assert.True(t, everPVOps, "everPVOps")

	kerns, err = c.AvailKernels(Int(138), Bool(true))
	require.NoError(t, err)
	require.Len(t, kerns, 1)

	k := kerns[0]

	assert.True(t, k.IsXen)
	assert.True(t, k.IsPVOps)
	assert.NotEmpty(t, k.ID)
	assert.NotEmpty(t, k.Label)

	kerns, err = c.AvailKernels(Int(4389048234), Bool(false))
	require.NoError(t, err)
	require.Empty(t, kerns)
}
Example #19
0
func TestAvailStackScriptsOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockAvailStackScriptsOK()))
	defer ts.Close()

	scripts, err := c.AvailStackScripts(Int(1), String("bar"), String("baz"))
	require.NoError(t, err)
	require.Len(t, scripts, 1)

	s := scripts[0]
	assert.Equal(t, "Professional Services", s.RevNote)
	assert.Contains(t, s.Script, "#!/bin/bash")
	assert.Equal(t, "127", s.DistIDList)
	assert.Contains(t, s.Description, "cPanel takes an hour to install.")
	assert.Equal(t, "2015-01-07 15:48:57.0", s.RevDT)
	assert.Equal(t, "cPanel", s.Label)
	assert.Equal(t, 207, s.TotalDeploys)
	assert.Equal(t, 53081, s.LatestRev)
	assert.Equal(t, 11078, s.ID)
	assert.True(t, s.IsPublic)
	assert.Equal(t, 125, s.ActiveDeploys)
	assert.Equal(t, "2015-01-07 15:48:57.0", s.CreateDT)
	assert.Equal(t, 307510, s.UserID)
}
Example #20
0
func TestDomainListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockDomainListOK()))
	defer ts.Close()

	domains, err := c.DomainList(Int(716074))
	require.NoError(t, err)
	require.Len(t, domains, 1)
	d := domains[0]

	assert.Equal(t, 716074, d.ID)
	assert.Equal(t, "foo", d.Description)
	assert.Equal(t, 300, d.ExpireSec)
	assert.Equal(t, 300, d.RetrySec)
	assert.Equal(t, 1, d.Status)
	assert.Equal(t, "test", d.DisplayGroup)
	assert.Equal(t, "1;2;3;", d.MasterIPs)
	assert.Equal(t, 300, d.RefreshSec)
	assert.Equal(t, "[email protected]", d.SOAEmail)
	assert.Equal(t, 300, d.TTLSec)
	assert.Equal(t, "foo.com", d.Domain)
	assert.Equal(t, "master", d.Type)
	assert.Equal(t, "", d.AXFRIPs)
}
Example #21
0
func TestLinodeDiskListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockLinodeDiskListOK()))
	defer ts.Close()

	disks, err := c.LinodeDiskList(1146420, Int(1))
	require.NoError(t, err)
	require.Len(t, disks, 3)

	var foundTestSwap bool
	var foundTestDist bool
	var foundUpdatedLabel bool

	for _, d := range disks {
		if d.ID == 3582351 {
			foundTestSwap = true

			assert.True(t, d.IsReadOnly)
			assert.Equal(t, "test-swap", d.Label)
			assert.Equal(t, "2015-07-06 23:30:13.0", d.UpdateDT)
			assert.Equal(t, 1, d.Status)
			assert.Equal(t, 256, d.Size)
			assert.Equal(t, 1146420, d.LinodeID)
			assert.Equal(t, "2015-07-06 23:29:37.0", d.CreateDT)
			assert.Equal(t, "swap", d.Type)
		}
		if d.ID == 3582352 {
			foundTestDist = true
		}
		if d.ID == 3582356 {
			foundUpdatedLabel = true
		}
	}

	assert.True(t, foundTestSwap)
	assert.True(t, foundTestDist)
	assert.True(t, foundUpdatedLabel)
}
Example #22
0
func TestLinodeListOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockLinodeListOK()))
	defer ts.Close()

	nodes, err := c.LinodeList(Int(1139016))
	require.NoError(t, err)
	require.Len(t, nodes, 1)

	n := nodes[0]

	assert.True(t, n.AlertCPUEnabled, "n.AlertCPUEnabled")
	assert.True(t, n.AlertBWInEnabled, "n.AlertBWINEnabled")
	assert.True(t, n.AlertBWQuotaEnabled, "n.AlertBWQuotaEnabled")
	assert.Equal(t, 10000, n.AlertDiskIOThreshold, "n.AlertDiskIOThreshold")
	assert.Equal(t, 0, n.BackupWindow, "n.BackupWindow")
	assert.Equal(t, true, n.Watchdog, "n.Watchdog")
	assert.Equal(t, "foo", n.DistVendor, "n.DistVendor")
	assert.Equal(t, 2, n.DatacenterID, "n.DatacenterID")
	assert.Equal(t, 1, n.Status, "n.Status")
	assert.True(t, n.AlertDiskIOEnabled, "n.AlertDiskIOEnabled")
	assert.Equal(t, "2015-07-02 23:08:52.0", n.CreateDT, "n.CreateDT")
	assert.Equal(t, 24576, n.TotalHD, "n.TotalHD")
	assert.Equal(t, 80, n.AlertBWQuotaThreshold, "n.AlertBWQUotaThreshold")
	assert.Equal(t, 1024, n.TotalRAM, "n.TotalRAM")
	assert.Equal(t, 10, n.AlertBWInThreshold, "n.AlertBWInThreshold")
	assert.Equal(t, 1139016, n.ID, "n.ID")
	assert.Equal(t, 10, n.AlertBWOutThreshold, "n.AlertBWOutThreshold")
	assert.True(t, n.AlertBWOutEnabled, "n.AlertBWOutEnabled")
	assert.True(t, n.BackupsEnabled, "n.BackupsEnabled")
	assert.Equal(t, 90, n.AlertCPUThreshold, "n.AlertCPUThreshold")
	assert.Equal(t, 1, n.PlanID, "n.PlanID")
	assert.Equal(t, 1, n.BackupWeeklyDay, "n.BackupWeeklyDay")
	assert.Equal(t, "linode1139016", n.Label, "n.Label")
	assert.Equal(t, "bar", n.DisplayGroup, "n.DisplayGroup")
	assert.Equal(t, 2000, n.TotalXfer, "n.TotalXfer")
}
Example #23
0
func TestLinodeJobListFinishedOK(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockLinodeJobListFinishedOK()))
	defer ts.Close()

	jobs, err := c.LinodeJobList(1139016, Int(25088076), Bool(false))
	require.NoError(t, err)
	require.Len(t, jobs, 1)

	j := jobs[0]

	assert.True(t, j.Done())
	assert.True(t, j.Success())

	assert.Equal(t, "2015-07-03 23:51:41.0", j.EnteredDT)
	assert.Equal(t, "fs.create", j.Action)
	assert.Equal(t, "Create Filesystem - test-swap", j.Label)
	assert.Equal(t, "2015-07-03 23:51:51.0", j.HostStartDT)
	assert.Equal(t, 1139016, j.LinodeID)
	assert.Equal(t, "2015-07-03 23:51:51.0", j.HostFinishDT)
	assert.Equal(t, 5, j.Duration)
	assert.Equal(t, "foo", j.HostMessage)
	assert.Equal(t, 25088076, j.ID)
	assert.Equal(t, true, j.HostSuccess)
}
Example #24
0
func TestNodeBalancerIntegration(t *testing.T) {
	c := NewClient(apiKey)

	t.Log("creating test linode...")
	linodeID, err := c.LinodeCreate(2, 1, nil)
	require.NoError(t, err)
	require.NotEmpty(t, linodeID)

	err = c.WaitForAllJobs(linodeID, 3*time.Second, 60*time.Second)
	require.NoError(t, err)

	t.Log("assigning private IP...")
	_, linodeIP, err := c.LinodeIPAddPrivate(linodeID)
	require.NoError(t, err)
	require.NotEmpty(t, linodeIP)

	t.Log("nodebalancer.create...")
	nbID, err := c.NodeBalancerCreate(2, String("testing"), Int(5))
	require.NoError(t, err)
	require.NotEmpty(t, nbID)

	t.Log("nodebalancer.list...")
	nbList, err := c.NodeBalancerList(Int(nbID))
	require.NoError(t, err)
	require.Len(t, nbList, 1)

	n := nbList[0]
	assert.NotEmpty(t, n.Hostname)
	assert.Equal(t, "testing", n.Label)
	assert.Equal(t, 5, n.Throttle)
	assert.Equal(t, 2, n.DatacenterID)
	assert.NotEmpty(t, n.IPv4Addr)
	assert.NotEmpty(t, n.IPv6Addr)
	assert.Equal(t, nbID, n.ID)

	t.Log("nodebalancer.update...")
	err = c.NodeBalancerUpdate(nbID, String("testing-2"), Int(10))
	require.NoError(t, err)

	t.Log("nodebalancer.list...")
	nbList, err = c.NodeBalancerList(Int(nbID))
	require.NoError(t, err)
	require.Len(t, nbList, 1)

	n = nbList[0]
	assert.Equal(t, "testing-2", n.Label)
	assert.Equal(t, 10, n.Throttle)
	assert.Equal(t, nbID, n.ID)

	nbcco := NodeBalancerConfigCreateOpts{
		Port:          Int(80),
		Protocol:      String("http"),
		Algorithm:     String("roundrobin"),
		Stickiness:    String("http_cookie"),
		Check:         String("http"),
		CheckInterval: Int(30),
		CheckTimeout:  Int(29),
		CheckAttempts: Int(15),
		CheckPath:     String("/foo"),
		CheckBody:     String("bar"),
		CheckPassive:  Bool(false),
	}

	t.Log("nodebalancer.config.create...")
	confID, err := c.NodeBalancerConfigCreate(nbID, nbcco)
	require.NoError(t, err)
	require.NotEmpty(t, confID)

	t.Log("nodebalancer.config.list...")
	nbconfs, err := c.NodeBalancerConfigList(nbID, Int(confID))
	require.NoError(t, err)
	require.Len(t, nbconfs, 1)

	nbc := nbconfs[0]
	assert.Equal(t, "http_cookie", nbc.Stickiness)
	assert.Equal(t, "", nbc.SSLCommonName)
	assert.Equal(t, "/foo", nbc.CheckPath)
	assert.Equal(t, "bar", nbc.CheckBody)
	assert.Equal(t, 30, nbc.CheckInterval)
	assert.Equal(t, "", nbc.SSLFingerprint)
	assert.Equal(t, "roundrobin", nbc.Algorithm)
	assert.Equal(t, confID, nbc.ID)
	assert.Equal(t, 15, nbc.CheckAttempts)
	assert.Equal(t, nbID, nbc.NodeBalancerID)
	assert.Equal(t, 80, nbc.Port)
	assert.Equal(t, "http", nbc.Check)
	assert.False(t, nbc.CheckPassive)
	assert.Equal(t, "http", nbc.Protocol)
	assert.Equal(t, 29, nbc.CheckTimeout)

	nbcuo := NodeBalancerConfigUpdateOpts{
		Port:          Int(90),
		Protocol:      String("https"),
		Algorithm:     String("leastconn"),
		Stickiness:    String("table"),
		Check:         String("http_body"),
		CheckInterval: Int(24),
		CheckTimeout:  Int(23),
		CheckAttempts: Int(20),
		CheckPath:     String("/bar"),
		CheckBody:     String("quux"),
		CheckPassive:  Bool(true),
		SSLCert:       String(sslCert),
		SSLKey:        String(sslKey),
	}

	t.Log("nodebalancer.config.update...")
	err = c.NodeBalancerConfigUpdate(confID, nbcuo)
	require.NoError(t, err)

	t.Log("nodebalancer.config.list...")
	nbconfs, err = c.NodeBalancerConfigList(nbID, Int(confID))
	require.NoError(t, err)
	require.Len(t, nbconfs, 1)

	nbc = nbconfs[0]
	assert.Equal(t, "table", nbc.Stickiness)
	assert.Equal(t, "foo.com", nbc.SSLCommonName)
	assert.Equal(t, "/bar", nbc.CheckPath)
	assert.Equal(t, "quux", nbc.CheckBody)
	assert.Equal(t, 24, nbc.CheckInterval)
	assert.Equal(t, "0B:40:09:0C:4E:DA:5B:FB:2A:31:69:C9:4D:80:AE:CE:76:8F:DA:60", nbc.SSLFingerprint)
	assert.Equal(t, "leastconn", nbc.Algorithm)
	assert.Equal(t, confID, nbc.ID)
	assert.Equal(t, 20, nbc.CheckAttempts)
	assert.Equal(t, nbID, nbc.NodeBalancerID)
	assert.Equal(t, 90, nbc.Port)
	assert.Equal(t, "http_body", nbc.Check)
	assert.True(t, nbc.CheckPassive)
	assert.Equal(t, "https", nbc.Protocol)
	assert.Equal(t, 23, nbc.CheckTimeout)

	t.Log("nodebalancer.node.create...")
	nbNodeID, err := c.NodeBalancerNodeCreate(confID, "test", linodeIP+":90", Int(50),
		String("accept"))
	require.NoError(t, err)
	require.NotEmpty(t, nbNodeID)

	t.Log("nodebalancer.node.list...")
	nbNodes, err := c.NodeBalancerNodeList(confID, Int(nbNodeID))
	require.NoError(t, err)
	require.Len(t, nbNodes, 1)

	node := nbNodes[0]
	assert.Equal(t, 50, node.Weight)
	assert.Equal(t, linodeIP+":90", node.Address)
	assert.Equal(t, "test", node.Label)
	assert.Equal(t, nbNodeID, node.ID)
	assert.Equal(t, "accept", node.Mode)
	assert.Equal(t, confID, node.ConfigID)
	assert.NotEmpty(t, node.Status)
	assert.Equal(t, nbID, node.NodeBalancerID)

	t.Log("nodebalancer.node.update...")
	err = c.NodeBalancerNodeUpdate(nbNodeID, String("test-2"), String(linodeIP+":80"),
		Int(60), String("reject"))
	require.NoError(t, err)

	t.Log("nodebalancer.node.list...")
	nbNodes, err = c.NodeBalancerNodeList(confID, Int(nbNodeID))
	require.NoError(t, err)
	require.Len(t, nbNodes, 1)

	node = nbNodes[0]
	assert.Equal(t, 60, node.Weight)
	assert.Equal(t, linodeIP+":80", node.Address)
	assert.Equal(t, "test-2", node.Label)
	assert.Equal(t, nbNodeID, node.ID)
	assert.Equal(t, "reject", node.Mode)
	assert.Equal(t, confID, node.ConfigID)
	assert.NotEmpty(t, node.Status)
	assert.Equal(t, nbID, node.NodeBalancerID)

	t.Log("nodebalancer.node.delete...")
	err = c.NodeBalancerNodeDelete(nbNodeID)
	require.NoError(t, err)

	t.Log("nodebalancer.config.delete...")
	err = c.NodeBalancerConfigDelete(nbID, confID)
	require.NoError(t, err)

	t.Log("nodebalancer.delete...")
	err = c.NodeBalancerDelete(nbID)
	require.NoError(t, err)

	t.Log("deleting test linode...")
	err = c.LinodeDelete(linodeID, Bool(true))
	require.NoError(t, err)
}
Example #25
0
func TestDomainIntegration(t *testing.T) {
	c := NewClient(apiKey)

	dco := DomainCreateOpts{
		Description:  String("foo"),
		SOAEmail:     String("[email protected]"),
		RefreshSec:   Int(20),
		RetrySec:     Int(30),
		ExpireSec:    Int(40),
		TTLSec:       Int(50),
		DisplayGroup: String("test"),
		Status:       Int(1),
	}

	t.Log("domain.create...")
	dID, err := c.DomainCreate("foo.com", "master", dco)
	require.NoError(t, err)
	require.NotEmpty(t, dID)

	t.Log("domain.list...")
	domains, err := c.DomainList(Int(dID))
	require.NoError(t, err)
	require.Len(t, domains, 1)
	d := domains[0]

	assert.Equal(t, dID, d.ID)
	assert.Equal(t, "foo", d.Description)
	assert.Equal(t, 300, d.ExpireSec)
	assert.Equal(t, 300, d.RetrySec)
	assert.Equal(t, 1, d.Status)
	assert.Equal(t, "test", d.DisplayGroup)
	assert.Equal(t, "", d.MasterIPs)
	assert.Equal(t, 300, d.RefreshSec)
	assert.Equal(t, "[email protected]", d.SOAEmail)
	assert.Equal(t, 300, d.TTLSec)
	assert.Equal(t, "foo.com", d.Domain)
	assert.Equal(t, "master", d.Type)
	assert.Equal(t, "", d.AXFRIPs)

	duo := DomainUpdateOpts{
		Domain:       String("baz.com"),
		Type:         String("master"),
		SOAEmail:     String("[email protected]"),
		RefreshSec:   Int(3600),
		RetrySec:     Int(3600),
		ExpireSec:    Int(3600),
		TTLSec:       Int(3600),
		DisplayGroup: String("still-testing"),
		Status:       Int(2),
	}

	t.Log("domain.update...")
	err = c.DomainUpdate(dID, duo)
	require.NoError(t, err)

	t.Log("domain.list...")
	domains, err = c.DomainList(Int(dID))
	require.NoError(t, err)
	require.Len(t, domains, 1)
	d = domains[0]

	assert.Equal(t, dID, d.ID)
	assert.Equal(t, 3600, d.ExpireSec)
	assert.Equal(t, 3600, d.RetrySec)
	assert.Equal(t, 2, d.Status)
	assert.Equal(t, "still-testing", d.DisplayGroup)
	assert.Equal(t, "", d.MasterIPs)
	assert.Equal(t, 3600, d.RefreshSec)
	assert.Equal(t, "[email protected]", d.SOAEmail)
	assert.Equal(t, 3600, d.TTLSec)
	assert.Equal(t, "baz.com", d.Domain)
	assert.Equal(t, "master", d.Type)
	assert.Equal(t, "", d.AXFRIPs)

	drco := DomainResourceCreateOpts{
		Name:     String("_foo._tcp"),
		Target:   String("bar.baz.com"),
		Priority: Int(5),
		Weight:   Int(10),
		Port:     Int(15),
		Protocol: String("bar"),
		TTLSec:   Int(20),
	}

	t.Log("domain.resource.create...")
	rID, err := c.DomainResourceCreate(dID, "srv", drco)
	require.NoError(t, err)
	require.NotEmpty(t, rID)

	t.Log("domain.resource.list...")
	resources, err := c.DomainResourceList(dID, Int(rID))
	require.NoError(t, err)
	require.Len(t, resources, 1)
	r := resources[0]

	assert.Equal(t, dID, r.DomainID)
	assert.Equal(t, 15, r.Port)
	assert.Equal(t, rID, r.ID)
	assert.Equal(t, "_foo._tcp", r.Name)
	assert.Equal(t, 10, r.Weight)
	assert.Equal(t, 300, r.TTLSec)
	assert.Equal(t, "bar.baz.com", r.Target)
	assert.Equal(t, 5, r.Priority)
	assert.Equal(t, "tcp", r.Protocol)
	assert.Equal(t, "srv", r.Type)

	druo := DomainResourceUpdateOpts{
		DomainID: Int(dID),
		Name:     String("_qux._udp"),
		Target:   String("qux.baz.com"),
		Priority: Int(20),
		Weight:   Int(25),
		Port:     Int(30),
		Protocol: String("udp"),
		TTLSec:   Int(301),
	}

	t.Log("domain.resource.update...")
	err = c.DomainResourceUpdate(rID, druo)
	require.NoError(t, err)

	t.Log("domain.resource.list...")
	resources, err = c.DomainResourceList(dID, Int(rID))
	require.NoError(t, err)
	require.Len(t, resources, 1)
	r = resources[0]

	assert.Equal(t, dID, r.DomainID)
	assert.Equal(t, 30, r.Port)
	assert.Equal(t, rID, r.ID)
	assert.Equal(t, "_qux._udp", r.Name)
	assert.Equal(t, 25, r.Weight)
	assert.Equal(t, 3600, r.TTLSec)
	assert.Equal(t, "qux.baz.com", r.Target)
	assert.Equal(t, 20, r.Priority)
	assert.Equal(t, "udp", r.Protocol)

	t.Log("domain.resource.delete...")
	err = c.DomainResourceDelete(dID, rID)
	require.NoError(t, err)

	t.Log("domain.delete...")
	err = c.DomainDelete(dID)
	require.NoError(t, err)
}
Example #26
0
func TestImageIntegration(t *testing.T) {
	c := NewClient(apiKey)

	t.Log("creating test linode...")
	linodeID, err := c.LinodeCreate(2, 1, nil)
	require.NoError(t, err)
	require.NotEmpty(t, linodeID)

	err = c.WaitForAllJobs(linodeID, 3*time.Second, 60*time.Second)
	require.NoError(t, err)

	t.Log("creating test disk...")
	jobID, dDiskID, err := c.LinodeDiskCreateFromDistribution(linodeID, 130, "test-image", 600,
		rootPass, nil)
	require.NoError(t, err)
	require.NotEmpty(t, dDiskID)
	require.NotEmpty(t, jobID)

	ok, err := c.WaitForJob(linodeID, jobID, 3*time.Second, 60*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("converting test disk to image...")
	jobID, imageID, err := c.LinodeDiskImagize(linodeID, dDiskID, String("foo"), String("bar"))
	require.NoError(t, err)
	require.NotEmpty(t, imageID)
	require.NotEmpty(t, jobID)

	ok, err = c.WaitForJob(linodeID, jobID, 3*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("image.list...")
	images, err := c.ImageList(&imageID, Bool(false))
	require.NoError(t, err)
	require.Len(t, images, 1)

	i := images[0]
	assert.Empty(t, i.LastUsedDT)
	assert.Equal(t, 600, i.MinSize)
	assert.Equal(t, "foo", i.Description)
	assert.Equal(t, "bar", i.Label)
	assert.NotEmpty(t, i.Creator)
	assert.Equal(t, "available", i.Status)
	assert.False(t, i.IsPublic)
	assert.NotEmpty(t, i.CreateDT)
	assert.Equal(t, "manual", i.Type)
	assert.Equal(t, "ext4", i.FSType)
	assert.Equal(t, imageID, i.ID)

	t.Log("image.update...")
	err = c.ImageUpdate(imageID, String("baz"), String("quux"))
	require.NoError(t, err)

	t.Log("image.list...")
	images, err = c.ImageList(&imageID, Bool(false))
	require.NoError(t, err)
	require.Len(t, images, 1)

	i = images[0]
	assert.Equal(t, "baz", i.Label)
	assert.Equal(t, "quux", i.Description)

	t.Log("image.delete...")
	err = c.ImageDelete(imageID)
	require.NoError(t, err)

	t.Log("cleaning up linode...")
	err = c.LinodeDelete(linodeID, Bool(true))
	require.NoError(t, err)
}
Example #27
0
func TestLinodeIntegration(t *testing.T) {
	c := NewClient(apiKey)

	t.Log("c.LinodeCreate...")
	id, err := c.LinodeCreate(2, 1, nil)
	require.NoError(t, err)
	require.NotEmpty(t, id)

	t.Log("c.WaitForAllJobs...")
	err = c.WaitForAllJobs(id, 2*time.Second, 60*time.Second)
	require.NoError(t, err)

	t.Log("c.LinodeList...")
	nodes, err := c.LinodeList(Int(id))
	require.NoError(t, err)
	require.Len(t, nodes, 1)

	t.Log("c.LinodeResize...")
	err = c.LinodeResize(id, 2)
	require.NoError(t, err)

	t.Log("c.LinodeUpdate...")
	linodeOpts := LinodeOpts{
		Label:                 String("integration-test"),
		DisplayGroup:          String("tests"),
		AlertCPUEnabled:       Bool(false),
		AlertCPUThreshold:     Int(50),
		AlertDiskIOEnabled:    Bool(false),
		AlertDiskIOThreshold:  Int(500),
		AlertBWInEnabled:      Bool(false),
		AlertBWInThreshold:    Int(30),
		AlertBWOutEnabled:     Bool(false),
		AlertBWOutThreshold:   Int(31),
		AlertBWQuotaEnabled:   Bool(false),
		AlertBWQuotaThreshold: Int(55),
		BackupWindow:          Int(3),
		BackupWeeklyDay:       Int(6),
		Watchdog:              Bool(false),
	}
	err = c.LinodeUpdate(id, linodeOpts)
	require.NoError(t, err)

	t.Log("c.LinodeDiskCreate...")
	jobID, swapDiskID, err := c.LinodeDiskCreate(id, "test-swap", "swap", 256)
	require.NoError(t, err)
	require.NotEmpty(t, swapDiskID, "swapDiskID")
	require.NotEmpty(t, jobID, "jobID")

	t.Log("c.WaitForJob...")
	ok, err := c.WaitForJob(id, jobID, 2*time.Second, 60*time.Second)
	require.NoError(t, err)
	require.True(t, ok, "creating swap failed")

	t.Log("c.LinodeDiskCreateFromDistribution...")
	jobID, distDiskID, err := c.LinodeDiskCreateFromDistribution(id, 130, "test-dist", 600,
		rootPass, String(rootSSHKey))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)
	require.NotEmpty(t, distDiskID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 80*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeConfigCreate...")
	lcco := LinodeConfigCreateOpts{
		Comments:              String("foo"),
		RAMLimit:              Int(800),
		VirtMode:              String("paravirt"),
		RunLevel:              String("default"),
		RootDeviceNum:         Int(1),
		RootDeviceRO:          Bool(true),
		HelperDisableUpdateDB: Bool(true),
		HelperDistro:          Bool(true),
		HelperXen:             Bool(true),
		HelperDepmod:          Bool(true),
		HelperNetwork:         Bool(true),
		DevTmpFSAutomount:     Bool(true),
	}
	diskList := strconv.Itoa(distDiskID) + "," + strconv.Itoa(swapDiskID) + ","
	confID, err := c.LinodeConfigCreate(id, 138, "test-conf1", diskList, lcco)
	require.NoError(t, err)
	require.NotEmpty(t, confID)

	t.Log("c.LinodeConfigList...")
	confs, err := c.LinodeConfigList(id, Int(confID))
	require.NoError(t, err)
	require.Len(t, confs, 1)

	cfg := confs[0]
	assert.Equal(t, "", cfg.RootDeviceCustom)
	assert.Equal(t, "foo", cfg.Comments)
	assert.Equal(t, "test-conf1", cfg.Label)
	assert.Equal(t, confID, cfg.ID)
	assert.NotEmpty(t, cfg.DiskList)
	assert.Equal(t, "default", cfg.RunLevel)
	assert.Equal(t, 1, cfg.RootDeviceNum)
	assert.Equal(t, 800, cfg.RAMLimit)
	assert.Equal(t, "paravirt", cfg.VirtMode)
	assert.Equal(t, id, cfg.LinodeID)
	assert.Equal(t, 138, cfg.KernelID)
	assert.True(t, cfg.DevTmpFSAutomount)
	assert.True(t, cfg.HelperDistro)
	assert.True(t, cfg.HelperDisableUpdateDB)
	assert.True(t, cfg.HelperDepmod)
	assert.True(t, cfg.HelperXen)
	assert.True(t, cfg.RootDeviceRO)
	assert.True(t, cfg.HelperNetwork)
	assert.False(t, cfg.IsRescue)

	t.Log("c.LinodeConfigUpdate...")
	lcuo := LinodeConfigUpdateOpts{
		LinodeID:              Int(id),
		KernelID:              Int(138),
		Comments:              String("foo"),
		RAMLimit:              Int(800),
		VirtMode:              String("paravirt"),
		RunLevel:              String("default"),
		RootDeviceNum:         Int(1),
		RootDeviceRO:          Bool(true),
		HelperDisableUpdateDB: Bool(true),
		HelperDistro:          Bool(true),
		HelperXen:             Bool(true),
		HelperDepmod:          Bool(true),
		HelperNetwork:         Bool(true),
		DevTmpFSAutomount:     Bool(true),
	}
	err = c.LinodeConfigUpdate(confID, lcuo)
	require.NoError(t, err)

	t.Log("c.LinodeDiskImagize...")
	jobID, imgID, err := c.LinodeDiskImagize(id, distDiskID, String("test-image desc"),
		String("test-image label"))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)
	require.NotEmpty(t, imgID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeDiskCreateFromImage...")
	jobID, imgDiskID, err := c.LinodeDiskCreateFromImage(imgID, id, "test-image", Int(800),
		String(rootPass), String(rootSSHKey))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)
	require.NotEmpty(t, imgDiskID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("deleting image...")
	err = c.ImageDelete(imgID)
	assert.NoError(t, err)

	t.Log("c.LinodeDiskDelete...")
	jobID, err = c.LinodeDiskDelete(id, imgDiskID)
	require.NoError(t, err)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 60*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeDiskDuplicate...")
	jobID, dupeDiskID, err := c.LinodeDiskDuplicate(id, swapDiskID)
	require.NoError(t, err)
	require.NotEmpty(t, dupeDiskID)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 60*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeDiskResize...")
	jobID, err = c.LinodeDiskResize(id, dupeDiskID, 512)
	require.NoError(t, err)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 1*time.Second, 60*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeDiskUpdate...")
	err = c.LinodeDiskUpdate(id, dupeDiskID, String("updated-label"), Bool(true))
	require.NoError(t, err)

	curDisks, err := c.LinodeDiskList(id, nil)
	require.NoError(t, err)
	require.Len(t, curDisks, 3)

	t.Log("c.LinodeIPList...")
	ipList, err := c.LinodeIPList(Int(id), nil)
	require.NoError(t, err)
	require.Len(t, ipList, 1)
	pubID := ipList[0].ID

	t.Log("c.LinodeIPAddPrivate...")
	_, _, err = c.LinodeIPAddPrivate(id)
	require.NoError(t, err)

	t.Log("c.LinodeIPList...")
	ipList, err = c.LinodeIPList(Int(id), nil)
	require.NoError(t, err)
	require.Len(t, ipList, 2)

	t.Log("c.LinodeClone...")
	cloneID, err := c.LinodeClone(id, 2, 1, nil, nil)
	require.NoError(t, err)
	require.NotEmpty(t, cloneID)

	t.Log("c.WaitForAllJobs...")
	err = c.WaitForAllJobs(cloneID, 2*time.Second, 60*time.Second)
	require.NoError(t, err)

	t.Log("c.LinodeIPList...")
	ipList, err = c.LinodeIPList(Int(cloneID), nil)
	require.NoError(t, err)
	require.Len(t, ipList, 1)
	clonePubID := ipList[0].ID

	t.Log("c.LinodeIPSwap...")
	err = c.LinodeIPSwap(pubID, Int(clonePubID), nil)
	require.NoError(t, err)

	t.Log("c.WaitForAllJobs...")
	err = c.WaitForAllJobs(cloneID, 2*time.Second, 60*time.Second)
	require.NoError(t, err)

	t.Log("c.LinodeDelete...")
	err = c.LinodeDelete(cloneID, Bool(true))
	require.NoError(t, err)

	ssOpts := struct {
		DBPassword    string `json:"db_password"`
		DBName        string `json:"db_name"`
		MySQLUsername string `json:"db_user"`
		MySQLUserpass string `json:"db_user_password"`
	}{
		"foo",
		"bar",
		"baz",
		"quux",
	}
	ssUDFResp, err := json.Marshal(ssOpts)
	require.NoError(t, err)

	t.Log("c.DiskCreateFromStackScript")
	jobID, diskID, err := c.LinodeDiskCreateFromStackScript(id, linodeLampStackSS, string(ssUDFResp),
		130, "test-ss", 600, rootPass, String(rootSSHKey))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)
	require.NotEmpty(t, diskID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeBoot...")
	jobID, err = c.LinodeBoot(id, Int(confID))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeReboot...")
	jobID, err = c.LinodeReboot(id, Int(confID))
	require.NoError(t, err)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	t.Log("c.LinodeShutdown...")
	jobID, err = c.LinodeShutdown(id)
	require.NoError(t, err)
	require.NotEmpty(t, jobID)

	t.Log("c.WaitForJob...")
	ok, err = c.WaitForJob(id, jobID, 2*time.Second, 120*time.Second)
	require.NoError(t, err)
	require.True(t, ok)

	err = c.LinodeConfigDelete(id, confID)
	require.NoError(t, err)

	t.Log("c.LinodeDelete...")
	err = c.LinodeDelete(id, Bool(true))

}