Skip to content

Commit 61163e2

Browse files
committed
move testdata to internal
1 parent defb6c9 commit 61163e2

14 files changed

+20
-20
lines changed

ctlog_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,95 +43,95 @@ func TestNewCertValidationOpts(t *testing.T) {
4343
desc: "missing-root-cert",
4444
wantErr: "failed to read trusted roots",
4545
cvcfg: ChainValidationConfig{
46-
RootsPEMFile: "./testdata/bogus.cert",
46+
RootsPEMFile: "./internal/testdata/bogus.cert",
4747
},
4848
},
4949
{
5050
desc: "rejecting-all",
5151
wantErr: "configuration would reject all certificates",
5252
cvcfg: ChainValidationConfig{
53-
RootsPEMFile: "./testdata/fake-ca.cert",
53+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
5454
RejectExpired: true,
5555
RejectUnexpired: true},
5656
},
5757
{
5858
desc: "unknown-ext-key-usage-1",
5959
wantErr: "unknown extended key usage",
6060
cvcfg: ChainValidationConfig{
61-
RootsPEMFile: "./testdata/fake-ca.cert",
61+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
6262
ExtKeyUsages: "wrong_usage"},
6363
},
6464
{
6565
desc: "unknown-ext-key-usage-2",
6666
wantErr: "unknown extended key usage",
6767
cvcfg: ChainValidationConfig{
68-
RootsPEMFile: "./testdata/fake-ca.cert",
68+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
6969
ExtKeyUsages: "ClientAuth,ServerAuth,TimeStomping",
7070
},
7171
},
7272
{
7373
desc: "unknown-ext-key-usage-3",
7474
wantErr: "unknown extended key usage",
7575
cvcfg: ChainValidationConfig{
76-
RootsPEMFile: "./testdata/fake-ca.cert",
76+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
7777
ExtKeyUsages: "Any ",
7878
},
7979
},
8080
{
8181
desc: "unknown-reject-ext",
8282
wantErr: "failed to parse RejectExtensions",
8383
cvcfg: ChainValidationConfig{
84-
RootsPEMFile: "./testdata/fake-ca.cert",
84+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
8585
RejectExtensions: "1.2.3.4,one.banana.two.bananas",
8686
},
8787
},
8888
{
8989
desc: "limit-before-start",
9090
wantErr: "before start",
9191
cvcfg: ChainValidationConfig{
92-
RootsPEMFile: "./testdata/fake-ca.cert",
92+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
9393
NotAfterStart: &t200,
9494
NotAfterLimit: &t100,
9595
},
9696
},
9797
{
9898
desc: "ok",
9999
cvcfg: ChainValidationConfig{
100-
RootsPEMFile: "./testdata/fake-ca.cert",
100+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
101101
},
102102
},
103103
{
104104
desc: "ok-ext-key-usages",
105105
cvcfg: ChainValidationConfig{
106-
RootsPEMFile: "./testdata/fake-ca.cert",
106+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
107107
ExtKeyUsages: "ServerAuth,ClientAuth,OCSPSigning",
108108
},
109109
},
110110
{
111111
desc: "ok-reject-ext",
112112
cvcfg: ChainValidationConfig{
113-
RootsPEMFile: "./testdata/fake-ca.cert",
113+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
114114
RejectExtensions: "1.2.3.4,5.6.7.8",
115115
},
116116
},
117117
{
118118
desc: "ok-start-timestamp",
119119
cvcfg: ChainValidationConfig{
120-
RootsPEMFile: "./testdata/fake-ca.cert",
120+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
121121
NotAfterStart: &t100,
122122
},
123123
},
124124
{
125125
desc: "ok-limit-timestamp",
126126
cvcfg: ChainValidationConfig{
127-
RootsPEMFile: "./testdata/fake-ca.cert",
127+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
128128
NotAfterStart: &t200,
129129
},
130130
},
131131
{
132132
desc: "ok-range-timestamp",
133133
cvcfg: ChainValidationConfig{
134-
RootsPEMFile: "./testdata/fake-ca.cert",
134+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
135135
NotAfterStart: &t100,
136136
NotAfterLimit: &t200,
137137
},
@@ -154,7 +154,7 @@ func TestNewCertValidationOpts(t *testing.T) {
154154

155155
func TestNewLog(t *testing.T) {
156156
ctx := context.Background()
157-
signer, err := pem.ReadPrivateKeyFile("./testdata/ct-http-server.privkey.pem", "dirk")
157+
signer, err := pem.ReadPrivateKeyFile("./internal/testdata/ct-http-server.privkey.pem", "dirk")
158158
if err != nil {
159159
t.Fatalf("Can't open key: %v", err)
160160
}
@@ -175,7 +175,7 @@ func TestNewLog(t *testing.T) {
175175
desc: "ok",
176176
origin: "testlog",
177177
cvcfg: ChainValidationConfig{
178-
RootsPEMFile: "./testdata/fake-ca.cert",
178+
RootsPEMFile: "./internal/testdata/fake-ca.cert",
179179
},
180180
signer: signer,
181181
},

internal/scti/chain_validation_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/google/certificate-transparency-go/x509"
2626
"github.com/google/certificate-transparency-go/x509/pkix"
2727
"github.com/google/certificate-transparency-go/x509util"
28-
"github.com/transparency-dev/static-ct/testdata"
28+
"github.com/transparency-dev/static-ct/internal/testdata"
2929
)
3030

3131
func wipeExtensions(cert *x509.Certificate) *x509.Certificate {
@@ -172,12 +172,12 @@ func TestValidateChain(t *testing.T) {
172172
},
173173
{
174174
desc: "chain-of-len-4",
175-
chain: pemFileToDERChain(t, "./testdata/subleaf.chain"),
175+
chain: pemFileToDERChain(t, "../testdata/subleaf.chain"),
176176
wantPathLen: 4,
177177
},
178178
{
179179
desc: "misordered-chain-of-len-4",
180-
chain: pemFileToDERChain(t, "./testdata/subleaf.misordered.chain"),
180+
chain: pemFileToDERChain(t, "../testdata/subleaf.misordered.chain"),
181181
wantErr: true,
182182
},
183183
{

internal/scti/handlers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ import (
3535
"github.com/google/go-cmp/cmp"
3636
"github.com/google/go-cmp/cmp/cmpopts"
3737
"github.com/google/trillian/monitoring"
38+
"github.com/transparency-dev/static-ct/internal/testdata"
3839
"github.com/transparency-dev/static-ct/mockstorage"
3940
"github.com/transparency-dev/static-ct/modules/dedup"
40-
"github.com/transparency-dev/static-ct/testdata"
4141
"github.com/transparency-dev/trillian-tessera/ctonly"
4242
"google.golang.org/grpc/codes"
4343
"google.golang.org/grpc/status"

internal/scti/signatures_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/google/certificate-transparency-go/x509"
2727
"github.com/google/certificate-transparency-go/x509util"
2828
"github.com/kylelemons/godebug/pretty"
29-
"github.com/transparency-dev/static-ct/testdata"
29+
"github.com/transparency-dev/static-ct/internal/testdata"
3030

3131
ct "github.com/google/certificate-transparency-go"
3232
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)