Пример #1
0
//TestPostApplyDeploymentJobs test job Task
//TODO: This test requires a server profile to have been created
func TestPostApplyDeploymentJobs(t *testing.T) {
	var (
		d *ICSPTest
		c *icsp.ICSPClient
	)
	if os.Getenv("ICSP_TEST_ACCEPTANCE") == "true" {
		d, c = getTestDriverA()
		if c == nil {
			t.Fatalf("Failed to execute getTestDriver() ")
		}

		serialNumber := d.Tc.GetTestData(d.Env, "FreeICSPSerialNumber").(string)
		s, err := c.GetServerBySerialNumber(serialNumber) // fake serial number

		// (c *ICSPClient) GetJob(u ODSUri) (Job, error) {
		// create a jt *JobTask object
		// JobURI
		var jt *icsp.JobTask
		var testURL utils.Nstring
		testURL = "/rest/os-deployment-jobs/5350001"
		jt = &icsp.JobTask{
			JobURI: icsp.ODSUri{URI: testURL},
			Client: c,
		}
		var findprops []string
		findprops = append(findprops, "public_ip")
		err = c.PostApplyDeploymentJobs(jt, s, findprops)
		assert.NoError(t, err, "PostApplyDeploymentJobs threw error -> %s, %+v\n", err, jt)
	}
}