コード例 #1
0
			rebooted, err := virtualGuestService.RebootHard(virtualGuest.Id)
			Expect(err).To(HaveOccurred())
			Expect(rebooted).To(BeFalse())
		})
	})

	Context("#SetUserMetadata", func() {
		BeforeEach(func() {
			virtualGuest.Id = 1234567
			fakeClient.DoRawHttpRequestResponse, err = testhelpers.ReadJsonTestFixtures("services", "SoftLayer_Virtual_Guest_Service_setMetadata.json")
			Expect(err).ToNot(HaveOccurred())
		})

		It("sucessfully adds metadata strings as a dile to virtual guest's metadata disk", func() {
			retBool, err := virtualGuestService.SetMetadata(virtualGuest.Id, "fake-metadata")
			Expect(err).ToNot(HaveOccurred())

			Expect(retBool).To(BeTrue())
		})
	})

	Context("#GetUserData", func() {
		BeforeEach(func() {
			virtualGuest.Id = 1234567
			fakeClient.DoRawHttpRequestResponse, err = testhelpers.ReadJsonTestFixtures("services", "SoftLayer_Virtual_Guest_Service_getUserData.json")
			Expect(err).ToNot(HaveOccurred())
		})

		It("sucessfully returns user data for the virtual guest", func() {
			attributes, err := virtualGuestService.GetUserData(virtualGuest.Id)