diff options
| author | Joseph Richey <joerichey@google.com> | 2017-07-18 21:51:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-18 21:51:15 -0700 |
| commit | 8f4830c7715e5719780f195ce3400b8768c30688 (patch) | |
| tree | 2db0016cc45fb35ab027a7dd95c8050a05605143 /metadata | |
| parent | 8867856db45abaed8b9e2539ee7c34d99360db56 (diff) | |
| parent | cc2de52228d89b2fbc53bc0e710aae699434d6da (diff) | |
Merge pull request #23 from google/fix
travis CI: Test config file
Diffstat (limited to 'metadata')
| -rw-r--r-- | metadata/config.go | 1 | ||||
| -rw-r--r-- | metadata/metadata.pb.go | 86 | ||||
| -rw-r--r-- | metadata/metadata.proto | 1 | ||||
| -rw-r--r-- | metadata/policy_test.go | 25 |
4 files changed, 56 insertions, 57 deletions
diff --git a/metadata/config.go b/metadata/config.go index 8c7be55..0f95fbe 100644 --- a/metadata/config.go +++ b/metadata/config.go @@ -26,7 +26,6 @@ // * Reasonable defaults for a Policy's EncryptionOptions package metadata -//go:generate protoc --go_out=. metadata.proto import ( "io" "strings" diff --git a/metadata/metadata.pb.go b/metadata/metadata.pb.go index 37087ef..49a9f3c 100644 --- a/metadata/metadata.pb.go +++ b/metadata/metadata.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-go. -// source: metadata.proto +// source: metadata/metadata.proto // DO NOT EDIT! /* Package metadata is a generated protocol buffer package. It is generated from these files: - metadata.proto + metadata/metadata.proto It has these top-level messages: HashingCosts @@ -368,48 +368,48 @@ func init() { proto.RegisterEnum("metadata.EncryptionOptions_Mode", EncryptionOptions_Mode_name, EncryptionOptions_Mode_value) } -func init() { proto.RegisterFile("metadata.proto", fileDescriptor0) } +func init() { proto.RegisterFile("metadata/metadata.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 626 bytes of a gzipped FileDescriptorProto + // 630 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 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, 0xfa, + 0x08, 0xeb, 0xf3, 0x3a, 0x85, 0xf5, 0x34, 0xe5, 0x9a, 0x2b, 0xf1, 0xb6, 0x5a, 0xfd, 0x07, 0x37, + 0xea, 0x2d, 0x99, 0xe0, 0xb5, 0xe9, 0x35, 0x45, 0x85, 0xbf, 0x1d, 0xa8, 0x0f, 0x78, 0x76, 0xc1, + 0x2e, 0x2b, 0xed, 0xe1, 0xdc, 0xa1, 0x3d, 0x76, 0x01, 0xc6, 0x44, 0x8d, 0x47, 0x45, 0x3f, 0xb8, + 0xb7, 0xf6, 0x43, 0xd3, 0xac, 0x2c, 0xfe, 0x38, 0x8f, 0xa1, 0x13, 0xf1, 0x54, 0x10, 0xcd, 0xce, + 0x59, 0xc2, 0x74, 0x3e, 0x6b, 0xaf, 0x65, 0xb1, 0x0a, 0xa6, 0x76, 0x77, 0x30, 0x4f, 0x3f, 0x03, + 0x2c, 0x2a, 0x5d, 0x7e, 0x67, 0x08, 0xba, 0x82, 0xa4, 0x23, 0x41, 0x94, 0x12, 0x63, 0x49, 0x14, + 0xf5, 0x1d, 0x74, 0x0f, 0xd6, 0xa2, 0x89, 0xd2, 0x7c, 0x49, 0x76, 0xcd, 0x3e, 0x49, 0xa6, 0x86, + 0xa9, 0xef, 0x9d, 0xd7, 0xed, 0x2f, 0xf4, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xff, + 0x1e, 0x31, 0x5d, 0x05, 0x00, 0x00, } diff --git a/metadata/metadata.proto b/metadata/metadata.proto index 395cdff..1bec64f 100644 --- a/metadata/metadata.proto +++ b/metadata/metadata.proto @@ -19,6 +19,7 @@ * the License. */ +// If you modify this file, be sure to run "go generate" on this package. syntax = "proto3"; package metadata; diff --git a/metadata/policy_test.go b/metadata/policy_test.go index cc6b36f..783a784 100644 --- a/metadata/policy_test.go +++ b/metadata/policy_test.go @@ -37,14 +37,13 @@ var goodPolicy = &PolicyData{ } // Creates a temporary directory for testing. -func createTestDirectory() (directory string, err error) { - baseDirectory, err := util.TestPath() +func createTestDirectory(t *testing.T) (directory string, err error) { + baseDirectory, err := util.TestRoot() if err != nil { - return + t.Skip(err) } if s, err := os.Stat(baseDirectory); err != nil || !s.IsDir() { - return "", fmt.Errorf("%s: %q is not a valid directory", - util.TestEnvVarName, baseDirectory) + return "", fmt.Errorf("test directory %q is not valid", baseDirectory) } directoryPath := filepath.Join(baseDirectory, "test") @@ -53,8 +52,8 @@ func createTestDirectory() (directory string, err error) { // Makes a test directory, makes a file in the directory, and fills the file // with data. Returns the directory name, file name, and error (if one). -func createTestFile() (directory, file string, err error) { - if directory, err = createTestDirectory(); err != nil { +func createTestFile(t *testing.T) (directory, file string, err error) { + if directory, err = createTestDirectory(t); err != nil { return } // Cleanup if the file creation fails @@ -77,7 +76,7 @@ func createTestFile() (directory, file string, err error) { // Tests that we can set a policy on an empty directory func TestSetPolicyEmptyDirectory(t *testing.T) { - directory, err := createTestDirectory() + directory, err := createTestDirectory(t) if err != nil { t.Fatal(err) } @@ -90,7 +89,7 @@ func TestSetPolicyEmptyDirectory(t *testing.T) { // Tests that we cannot set a policy on a nonempty directory func TestSetPolicyNonemptyDirectory(t *testing.T) { - directory, _, err := createTestFile() + directory, _, err := createTestFile(t) if err != nil { t.Fatal(err) } @@ -103,7 +102,7 @@ func TestSetPolicyNonemptyDirectory(t *testing.T) { // Tests that we cannot set a policy on a file func TestSetPolicyFile(t *testing.T) { - directory, file, err := createTestFile() + directory, file, err := createTestFile(t) if err != nil { t.Fatal(err) } @@ -120,7 +119,7 @@ func TestSetPolicyBadDescriptors(t *testing.T) { badDescriptors := []string{"123456789abcde", "xxxxxxxxxxxxxxxx", "0123456789abcdef00"} for _, badDescriptor := range badDescriptors { badPolicy := &PolicyData{KeyDescriptor: badDescriptor, Options: DefaultOptions} - directory, err := createTestDirectory() + directory, err := createTestDirectory(t) if err != nil { t.Fatal(err) } @@ -134,7 +133,7 @@ func TestSetPolicyBadDescriptors(t *testing.T) { // Tests that we get back the same policy that we set on a directory func TestGetPolicyEmptyDirectory(t *testing.T) { - directory, err := createTestDirectory() + directory, err := createTestDirectory(t) if err != nil { t.Fatal(err) } @@ -155,7 +154,7 @@ func TestGetPolicyEmptyDirectory(t *testing.T) { // Tests that we cannot get a policy on an unencrypted directory func TestGetPolicyUnencrypted(t *testing.T) { - directory, err := createTestDirectory() + directory, err := createTestDirectory(t) if err != nil { t.Fatal(err) } |