~james-page/ubuntu/wily/juju-core/mir-fixes

« back to all changes in this revision

Viewing changes to src/github.com/joyent/gosdc/cloudapi/cloudapi_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-04-07 18:24:59 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20140407182459-1b6zvm5ygm4ki7yp
Tags: 1.18.0-0ubuntu1
* New upstream release (LP: #1287147), including fixes for:
  - maas/lxc: LXC permission denied issue (LP: #1299588).
  - core: mega-watcher for machines does not include container
    addresses (LP: #1301464).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// gosdc - Go library to interact with the Joyent CloudAPI
 
3
//
 
4
//
 
5
// Copyright (c) 2013 Joyent Inc.
 
6
//
 
7
// Written by Daniele Stroppa <daniele.stroppa@joyent.com>
 
8
//
 
9
 
 
10
package cloudapi_test
 
11
 
 
12
import (
 
13
        "flag"
 
14
        gc "launchpad.net/gocheck"
 
15
        "testing"
 
16
 
 
17
        "github.com/joyent/gocommon/jpc"
 
18
)
 
19
 
 
20
const (
 
21
        testKey            = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdArXEuyqVPwJ7uT/QLFYrGLposHGKRP4U1YPuXFFYQMa2Mq9cke6c6YYoHpNU3mVjatHp+sicfQHcO9nPMaWXoIn53kWdldvo0brsqGXXaHcQCjCaSooJiMgG4jDWUmnfySOQA0sEAXcktqmePpLsDlih05mORiueAR1Mglrc6TiVvjd8ZTPhZejMzETVusMweIilE+K7cNjQVxwHId5WVjTRAqRCvZXAIcP2+fzDXTmuKWhSdln19bKz5AEp1jU/eg4D4PuQvwynb9A8Ra2SJnOZ2+9cfDVhrbpzVMty4qQU6WblJNjpLnLpkm8w0isYk2Vr13a+1/N941gFcZaZ daniele@lightman.local"
 
22
        testKeyFingerprint = "6b:06:0c:6b:0b:44:67:97:2c:4f:87:28:28:f3:c6:a9"
 
23
        packageId          = "d6ca9994-53e7-4adf-a818-aadd3c90a916"
 
24
        localPackageId     = "11223344-1212-abab-3434-aabbccddeeff"
 
25
        packageName        = "g3-standard-1-smartos"
 
26
        localPackageName   = "Small"
 
27
        imageId            = "f669428c-a939-11e2-a485-b790efc0f0c1"
 
28
        localImageId       = "12345678-a1a1-b2b2-c3c3-098765432100"
 
29
        testFwRule         = "FROM subnet 10.35.76.0/24 TO subnet 10.35.101.0/24 ALLOW tcp (PORT 80 AND PORT 443)"
 
30
        testUpdatedFwRule  = "FROM subnet 10.35.76.0/24 TO subnet 10.35.101.0/24 ALLOW tcp (port 80 AND port 443 AND port 8080)"
 
31
        networkId          = "42325ea0-eb62-44c1-8eb6-0af3e2f83abc"
 
32
        localNetworkId     = "123abc4d-0011-aabb-2233-ccdd4455"
 
33
)
 
34
 
 
35
var live = flag.Bool("live", false, "Include live Joyent Cloud tests")
 
36
var keyName = flag.String("key.name", "", "Specify the full path to the private key, defaults to ~/.ssh/id_rsa")
 
37
 
 
38
func Test(t *testing.T) {
 
39
        if *live {
 
40
                creds, err := jpc.CompleteCredentialsFromEnv(*keyName)
 
41
                if err != nil {
 
42
                        t.Fatalf("Error setting up test suite: %s", err.Error())
 
43
                }
 
44
                registerJoyentCloudTests(creds)
 
45
        }
 
46
        registerLocalTests(*keyName)
 
47
        gc.TestingT(t)
 
48
}