コード例 #1
0
func (s *ResourceMachineSuite) SetupTest() {
	var err error
	s.server, err = helpers.NewServer()
	s.Require().Nil(err)

	s.config = &Config{
		Account: helpers.TestAccount,
		Key:     helpers.TestKeyFile,
		KeyID:   helpers.TestKeyID,
		URL:     s.server.URL(),
	}

	s.api, err = s.config.Cloud()
	s.Require().Nil(err)

	s.initialID = "aaaaaaaa-bbbb-cccc-dddddddddddd"
	s.mock = NewMockResourceData(
		s.initialID,
		map[string]interface{}{
			"name":             "test",
			"package":          "12345678-aaaa-bbbb-cccc-000000000000",            // Micro
			"image":            "12345678-a1a1-b2b2-c3c3-098765432100",            // SmartOS Std
			"networks":         []interface{}{"123abc4d-0011-aabb-2233-ccdd4455"}, // Test-Joyent-Public
			"firewall_enabled": false,
			"tags": map[string]interface{}{
				"hello": "world",
			},
			"user_data": "hello, world",
		},
	)
}
コード例 #2
0
func (s *ResourceKeySuite) SetupTest() {
	var err error
	s.server, err = helpers.NewServer()
	s.Require().Nil(err)

	s.config = &Config{
		Account: helpers.TestAccount,
		Key:     helpers.TestKeyFile,
		KeyID:   helpers.TestKeyID,
		URL:     s.server.URL(),
	}

	s.api, err = s.config.Cloud()
	s.Require().Nil(err)

	s.mock = NewMockResourceData(
		"testkey",
		map[string]interface{}{
			"name": "testkey",
			"key":  helpers.TestPublicKeyData,
		},
	)
}
コード例 #3
0
func (s *ResourceFirewallRuleSuite) SetupTest() {
	var err error
	s.server, err = helpers.NewServer()
	s.Require().Nil(err)

	s.config = &Config{
		Account: helpers.TestAccount,
		Key:     helpers.TestKeyFile,
		KeyID:   helpers.TestKeyID,
		URL:     s.server.URL(),
	}

	s.api, err = s.config.Cloud()
	s.Require().Nil(err)

	s.initialID = "aaaaaaaa-bbbb-cccc-dddddddddddd"
	s.mock = NewMockResourceData(
		s.initialID,
		map[string]interface{}{
			"rule":    "FROM any TO tag www ALLOW tcp PORT 80",
			"enabled": true,
		},
	)
}