diff --git a/lint/base_test.go b/lint/base_test.go index 73599acee..c1de2c802 100644 --- a/lint/base_test.go +++ b/lint/base_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - "github.com/zmap/zlint/util" + "github.com/zmap/zcrypto/x509" ) func TestAllLintsHaveNameDescriptionSource(t *testing.T) { @@ -44,8 +44,10 @@ func TestAllLintsHaveSource(t *testing.T) { } func TestLintCheckEffective(t *testing.T) { + c := &x509.Certificate{ + NotBefore: time.Now(), + } l := Lint{} - c := util.ReadCertificate("../testlint/testCerts/caBasicConstCrit.pem") l.EffectiveDate = time.Time{} if l.CheckEffective(c) != true { diff --git a/lints/apple/lint_ct_sct_policy_count_unsatisfied_test.go b/lints/apple/lint_ct_sct_policy_count_unsatisfied_test.go index 1da2b402f..62966fcf4 100644 --- a/lints/apple/lint_ct_sct_policy_count_unsatisfied_test.go +++ b/lints/apple/lint_ct_sct_policy_count_unsatisfied_test.go @@ -15,11 +15,10 @@ package apple import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSCTCountPolicyUnsatisified(t *testing.T) { @@ -104,8 +103,7 @@ func TestSCTCountPolicyUnsatisified(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.Filename) - result := lint.Lints["w_ct_sct_policy_count_unsatisfied"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("w_ct_sct_policy_count_unsatisfied", tc.Filename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_ca_common_name_missing_test.go b/lints/cabf_br/lint_ca_common_name_missing_test.go index 7d40c43e3..85d4a8725 100644 --- a/lints/cabf_br/lint_ca_common_name_missing_test.go +++ b/lints/cabf_br/lint_ca_common_name_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaCommonNameMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caCommonNameMissing.pem" + inputPath := "caCommonNameMissing.pem" expected := lint.Error - out := lint.Lints["e_ca_common_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_common_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaCommonNameNotMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caCommonNameNotMissing.pem" + inputPath := "caCommonNameNotMissing.pem" expected := lint.Pass - out := lint.Lints["e_ca_common_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_common_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_country_name_invalid_test.go b/lints/cabf_br/lint_ca_country_name_invalid_test.go index 80baf17db..585552e0b 100644 --- a/lints/cabf_br/lint_ca_country_name_invalid_test.go +++ b/lints/cabf_br/lint_ca_country_name_invalid_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaCountryNameInvalid(t *testing.T) { - inputPath := "../../testlint/testCerts/caInvalCountryCode.pem" + inputPath := "caInvalCountryCode.pem" expected := lint.Error - out := lint.Lints["e_ca_country_name_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_country_name_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaCountryNameValid(t *testing.T) { - inputPath := "../../testlint/testCerts/caValCountry.pem" + inputPath := "caValCountry.pem" expected := lint.Pass - out := lint.Lints["e_ca_country_name_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_country_name_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_country_name_missing_test.go b/lints/cabf_br/lint_ca_country_name_missing_test.go index df3652f1c..a4c800bdb 100644 --- a/lints/cabf_br/lint_ca_country_name_missing_test.go +++ b/lints/cabf_br/lint_ca_country_name_missing_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) /************************************************ @@ -30,18 +30,18 @@ in which the CA’s place of business is located. ************************************************/ func TestCaCountryNameMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caBlankCountry.pem" + inputPath := "caBlankCountry.pem" expected := lint.Error - out := lint.Lints["e_ca_country_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_country_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaCountryNamePresent(t *testing.T) { - inputPath := "../../testlint/testCerts/caValCountry.pem" + inputPath := "caValCountry.pem" expected := lint.Pass - out := lint.Lints["e_ca_country_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_country_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_crl_sign_not_set_test.go b/lints/cabf_br/lint_ca_crl_sign_not_set_test.go index e51be6151..5fa0c26fb 100644 --- a/lints/cabf_br/lint_ca_crl_sign_not_set_test.go +++ b/lints/cabf_br/lint_ca_crl_sign_not_set_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaKeyUsageNoCRLSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNoCRL.pem" + inputPath := "caKeyUsageNoCRL.pem" expected := lint.Error - out := lint.Lints["e_ca_crl_sign_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_crl_sign_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyUsageCRLSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["e_ca_crl_sign_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_crl_sign_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_digital_signature_not_set_test.go b/lints/cabf_br/lint_ca_digital_signature_not_set_test.go index ab06b7738..713af1be3 100644 --- a/lints/cabf_br/lint_ca_digital_signature_not_set_test.go +++ b/lints/cabf_br/lint_ca_digital_signature_not_set_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaKeyUsageNoDigSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNoCertSign.pem" + inputPath := "caKeyUsageNoCertSign.pem" expected := lint.Notice - out := lint.Lints["n_ca_digital_signature_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_ca_digital_signature_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyUsageDigSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageWDigSign.pem" + inputPath := "caKeyUsageWDigSign.pem" expected := lint.Pass - out := lint.Lints["n_ca_digital_signature_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_ca_digital_signature_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_is_ca_test.go b/lints/cabf_br/lint_ca_is_ca_test.go index ede0d66c0..a7d82a4e8 100644 --- a/lints/cabf_br/lint_ca_is_ca_test.go +++ b/lints/cabf_br/lint_ca_is_ca_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestKeyCertSignNotCA(t *testing.T) { - inputPath := "../../testlint/testCerts/keyCertSignNotCA.pem" + inputPath := "keyCertSignNotCA.pem" expected := lint.Error - out := lint.Lints["e_ca_is_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_is_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyCertSignCA(t *testing.T) { - inputPath := "../../testlint/testCerts/keyCertSignCA.pem" + inputPath := "keyCertSignCA.pem" expected := lint.Pass - out := lint.Lints["e_ca_is_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_is_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_key_cert_sign_not_set_test.go b/lints/cabf_br/lint_ca_key_cert_sign_not_set_test.go index 547e2a78d..cd30eba68 100644 --- a/lints/cabf_br/lint_ca_key_cert_sign_not_set_test.go +++ b/lints/cabf_br/lint_ca_key_cert_sign_not_set_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaKeyUsageNoCertSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNoCertSign.pem" + inputPath := "caKeyUsageNoCertSign.pem" expected := lint.Error - out := lint.Lints["e_ca_key_cert_sign_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_cert_sign_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyUsageCertSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["e_ca_key_cert_sign_not_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_cert_sign_not_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_key_usage_missing_test.go b/lints/cabf_br/lint_ca_key_usage_missing_test.go index 1d89c64e0..db00d60b1 100644 --- a/lints/cabf_br/lint_ca_key_usage_missing_test.go +++ b/lints/cabf_br/lint_ca_key_usage_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaKeyUsageMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageMissing.pem" + inputPath := "caKeyUsageMissing.pem" expected := lint.Error - out := lint.Lints["e_ca_key_usage_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_usage_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyUsagePresent(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["e_ca_key_usage_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_usage_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_key_usage_not_critical_test.go b/lints/cabf_br/lint_ca_key_usage_not_critical_test.go index e383fb45c..1bcec948d 100644 --- a/lints/cabf_br/lint_ca_key_usage_not_critical_test.go +++ b/lints/cabf_br/lint_ca_key_usage_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaKeyUsageNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNotCrit.pem" + inputPath := "caKeyUsageNotCrit.pem" expected := lint.Error - out := lint.Lints["e_ca_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestKeyUsageCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["e_ca_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ca_organization_name_missing_test.go b/lints/cabf_br/lint_ca_organization_name_missing_test.go index a32881b2e..d197ad6a7 100644 --- a/lints/cabf_br/lint_ca_organization_name_missing_test.go +++ b/lints/cabf_br/lint_ca_organization_name_missing_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCAOrgNameBlank(t *testing.T) { - inputPath := "../../testlint/testCerts/caOrgNameEmpty.pem" + inputPath := "caOrgNameEmpty.pem" expected := lint.Error - out := lint.Lints["e_ca_organization_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_organization_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCAOrgNameMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caOrgNameMissing.pem" + inputPath := "caOrgNameMissing.pem" expected := lint.Error - out := lint.Lints["e_ca_organization_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_organization_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCAOrgNameValid(t *testing.T) { - inputPath := "../../testlint/testCerts/caValOrgName.pem" + inputPath := "caValOrgName.pem" expected := lint.Pass - out := lint.Lints["e_ca_organization_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_organization_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_dv_conflicts_with_locality_test.go b/lints/cabf_br/lint_cab_dv_conflicts_with_locality_test.go index 91d237f1d..33ee9383d 100644 --- a/lints/cabf_br/lint_cab_dv_conflicts_with_locality_test.go +++ b/lints/cabf_br/lint_cab_dv_conflicts_with_locality_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyNotConflictWithLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["e_cab_dv_conflicts_with_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyConflictsWithLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValWithLocal.pem" + inputPath := "domainValWithLocal.pem" expected := lint.Error - out := lint.Lints["e_cab_dv_conflicts_with_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_dv_conflicts_with_org_test.go b/lints/cabf_br/lint_cab_dv_conflicts_with_org_test.go index 687658309..cc225427c 100644 --- a/lints/cabf_br/lint_cab_dv_conflicts_with_org_test.go +++ b/lints/cabf_br/lint_cab_dv_conflicts_with_org_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyNotConflictWithOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["e_cab_dv_conflicts_with_org"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_org", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyConflictsWithOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValWithOrg.pem" + inputPath := "domainValWithOrg.pem" expected := lint.Error - out := lint.Lints["e_cab_dv_conflicts_with_org"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_org", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_dv_conflicts_with_postal_test.go b/lints/cabf_br/lint_cab_dv_conflicts_with_postal_test.go index 37eef26cf..cc4275897 100644 --- a/lints/cabf_br/lint_cab_dv_conflicts_with_postal_test.go +++ b/lints/cabf_br/lint_cab_dv_conflicts_with_postal_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyNotConflictWithPostal(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["e_cab_dv_conflicts_with_postal"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_postal", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyConflictsWithPostal(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValWithPostal.pem" + inputPath := "domainValWithPostal.pem" expected := lint.Error - out := lint.Lints["e_cab_dv_conflicts_with_postal"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_postal", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_dv_conflicts_with_province_test.go b/lints/cabf_br/lint_cab_dv_conflicts_with_province_test.go index 08e9c2a98..0d383b735 100644 --- a/lints/cabf_br/lint_cab_dv_conflicts_with_province_test.go +++ b/lints/cabf_br/lint_cab_dv_conflicts_with_province_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyNotConflictWithProv(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["e_cab_dv_conflicts_with_province"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_province", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyConflictsWithProv(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValWithProvince.pem" + inputPath := "domainValWithProvince.pem" expected := lint.Error - out := lint.Lints["e_cab_dv_conflicts_with_province"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_province", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_dv_conflicts_with_street_test.go b/lints/cabf_br/lint_cab_dv_conflicts_with_street_test.go index 82491cfa3..f972d9104 100644 --- a/lints/cabf_br/lint_cab_dv_conflicts_with_street_test.go +++ b/lints/cabf_br/lint_cab_dv_conflicts_with_street_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyNotConflictWithStreet(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["e_cab_dv_conflicts_with_street"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_street", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyConflictsWithStreet(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValWithStreet.pem" + inputPath := "domainValWithStreet.pem" expected := lint.Error - out := lint.Lints["e_cab_dv_conflicts_with_street"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_dv_conflicts_with_street", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_iv_requires_personal_name_test.go b/lints/cabf_br/lint_cab_iv_requires_personal_name_test.go index 682bc46c0..43f83bbe6 100644 --- a/lints/cabf_br/lint_cab_iv_requires_personal_name_test.go +++ b/lints/cabf_br/lint_cab_iv_requires_personal_name_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyIvHasPerson(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValGoodAllFields.pem" + inputPath := "indivValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cab_iv_requires_personal_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_iv_requires_personal_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyIvHasSurname(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValSurnameOnly.pem" + inputPath := "indivValSurnameOnly.pem" expected := lint.Error - out := lint.Lints["e_cab_iv_requires_personal_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_iv_requires_personal_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyIvHasLastName(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValGivenNameOnly.pem" + inputPath := "indivValGivenNameOnly.pem" expected := lint.Error - out := lint.Lints["e_cab_iv_requires_personal_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_iv_requires_personal_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyIvNoPerson(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValNoOrgOrPersonalNames.pem" + inputPath := "indivValNoOrgOrPersonalNames.pem" expected := lint.Error - out := lint.Lints["e_cab_iv_requires_personal_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_iv_requires_personal_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cab_ov_requires_org_test.go b/lints/cabf_br/lint_cab_ov_requires_org_test.go index bcf8dbe7c..5f089d93d 100644 --- a/lints/cabf_br/lint_cab_ov_requires_org_test.go +++ b/lints/cabf_br/lint_cab_ov_requires_org_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyOvHasOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cab_ov_requires_org"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_ov_requires_org", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyOvNoOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValNoOrg.pem" + inputPath := "orgValNoOrg.pem" expected := lint.Error - out := lint.Lints["e_cab_ov_requires_org"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cab_ov_requires_org", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cert_policy_iv_requires_country_test.go b/lints/cabf_br/lint_cert_policy_iv_requires_country_test.go index f4bf87a44..ded14db17 100644 --- a/lints/cabf_br/lint_cert_policy_iv_requires_country_test.go +++ b/lints/cabf_br/lint_cert_policy_iv_requires_country_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyIvCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValGoodAllFields.pem" + inputPath := "indivValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cert_policy_iv_requires_country"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_iv_requires_country", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyIvNoCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValNoCountry.pem" + inputPath := "indivValNoCountry.pem" expected := lint.Error - out := lint.Lints["e_cert_policy_iv_requires_country"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_iv_requires_country", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cert_policy_iv_requires_province_or_locality_test.go b/lints/cabf_br/lint_cert_policy_iv_requires_province_or_locality_test.go index 409de5510..0f25411ea 100644 --- a/lints/cabf_br/lint_cert_policy_iv_requires_province_or_locality_test.go +++ b/lints/cabf_br/lint_cert_policy_iv_requires_province_or_locality_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyHasCountryOrLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValGoodAllFields.pem" + inputPath := "indivValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cert_policy_iv_requires_province_or_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_iv_requires_province_or_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyIvNoCountryOrLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValNoLocalOrProvince.pem" + inputPath := "indivValNoLocalOrProvince.pem" expected := lint.Error - out := lint.Lints["e_cert_policy_iv_requires_province_or_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_iv_requires_province_or_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cert_policy_ov_requires_country_test.go b/lints/cabf_br/lint_cert_policy_ov_requires_country_test.go index 96087a840..3a519702b 100644 --- a/lints/cabf_br/lint_cert_policy_ov_requires_country_test.go +++ b/lints/cabf_br/lint_cert_policy_ov_requires_country_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyOvHasCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cert_policy_ov_requires_country"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_ov_requires_country", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyOvNoCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValNoCountry.pem" + inputPath := "orgValNoCountry.pem" expected := lint.Error - out := lint.Lints["e_cert_policy_ov_requires_country"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_ov_requires_country", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_cert_policy_ov_requires_province_or_locality_test.go b/lints/cabf_br/lint_cert_policy_ov_requires_province_or_locality_test.go index f92e8f65e..86baff995 100644 --- a/lints/cabf_br/lint_cert_policy_ov_requires_province_or_locality_test.go +++ b/lints/cabf_br/lint_cert_policy_ov_requires_province_or_locality_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyOvHasCountryOrLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cert_policy_ov_requires_province_or_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_ov_requires_province_or_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyOvNoCountryOrLocal(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValNoProvinceOrLocal.pem" + inputPath := "orgValNoProvinceOrLocal.pem" expected := lint.Error - out := lint.Lints["e_cert_policy_ov_requires_province_or_locality"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_policy_ov_requires_province_or_locality", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_bad_character_in_label_test.go b/lints/cabf_br/lint_dnsname_bad_character_in_label_test.go index 36452a8e1..6238f91bf 100644 --- a/lints/cabf_br/lint_dnsname_bad_character_in_label_test.go +++ b/lints/cabf_br/lint_dnsname_bad_character_in_label_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBadCharacterInDNSLabel(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameBadCharacterInLabel.pem" + inputPath := "dnsNameBadCharacterInLabel.pem" expected := lint.Error - out := lint.Lints["e_dnsname_bad_character_in_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_bad_character_in_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestClientDNSCertificate(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameClientCert.pem" + inputPath := "dnsNameClientCert.pem" expected := lint.NA - out := lint.Lints["e_dnsname_bad_character_in_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_bad_character_in_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestClientValidCertificate(t *testing.T) { - inputPath := "../../testlint/testCerts/validComodo.pem" + inputPath := "validComodo.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_bad_character_in_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_bad_character_in_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_check_left_label_wildcard_test.go b/lints/cabf_br/lint_dnsname_check_left_label_wildcard_test.go index e24736b12..66134f145 100644 --- a/lints/cabf_br/lint_dnsname_check_left_label_wildcard_test.go +++ b/lints/cabf_br/lint_dnsname_check_left_label_wildcard_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestLeftLabelWildcardCorrect(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardCorrect.pem" + inputPath := "dnsNameWildcardCorrect.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_left_label_wildcard_correct"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_left_label_wildcard_correct", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestLeftLabelWildcardIncorrect(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardIncorrect.pem" + inputPath := "dnsNameWildcardIncorrect.pem" expected := lint.Error - out := lint.Lints["e_dnsname_left_label_wildcard_correct"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_left_label_wildcard_correct", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_contains_bare_iana_suffix_test.go b/lints/cabf_br/lint_dnsname_contains_bare_iana_suffix_test.go index 572af48b3..a85fd8c58 100644 --- a/lints/cabf_br/lint_dnsname_contains_bare_iana_suffix_test.go +++ b/lints/cabf_br/lint_dnsname_contains_bare_iana_suffix_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANABareSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameContainsBareIANASuffix.pem" + inputPath := "dnsNameContainsBareIANASuffix.pem" expected := lint.Error - out := lint.Lints["e_dnsname_contains_bare_iana_suffix"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_contains_bare_iana_suffix", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_contains_empty_label_test.go b/lints/cabf_br/lint_dnsname_contains_empty_label_test.go index 08a26215e..41a605ba3 100644 --- a/lints/cabf_br/lint_dnsname_contains_empty_label_test.go +++ b/lints/cabf_br/lint_dnsname_contains_empty_label_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameEmptyLabel(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameEmptyLabel.pem" + inputPath := "dnsNameEmptyLabel.pem" expected := lint.Error - out := lint.Lints["e_dnsname_empty_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_empty_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameNotEmptyLabel(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNotEmptyLabel.pem" + inputPath := "dnsNameNotEmptyLabel.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_empty_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_empty_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_hyphen_in_sld_test.go b/lints/cabf_br/lint_dnsname_hyphen_in_sld_test.go index 83d663be0..e826a30dc 100644 --- a/lints/cabf_br/lint_dnsname_hyphen_in_sld_test.go +++ b/lints/cabf_br/lint_dnsname_hyphen_in_sld_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameHyphenBeginningSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameHyphenBeginningSLD.pem" + inputPath := "dnsNameHyphenBeginningSLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_hyphen_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_hyphen_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameHyphenEndingSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameHyphenEndingSLD.pem" + inputPath := "dnsNameHyphenEndingSLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_hyphen_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_hyphen_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameNoHyphenInSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardCorrect.pem" + inputPath := "dnsNameWildcardCorrect.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_hyphen_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_hyphen_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNamePrivatePublicSuffixNoHyphenInSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNamePrivatePublicSuffix.pem" + inputPath := "dnsNamePrivatePublicSuffix.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_hyphen_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_hyphen_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_label_too_long_test.go b/lints/cabf_br/lint_dnsname_label_too_long_test.go index 7923cd7a3..dc76bc305 100644 --- a/lints/cabf_br/lint_dnsname_label_too_long_test.go +++ b/lints/cabf_br/lint_dnsname_label_too_long_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameLabelTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameLabelTooLong.pem" + inputPath := "dnsNameLabelTooLong.pem" expected := lint.Error - out := lint.Lints["e_dnsname_label_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_label_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_right_label_valid_tld_test.go b/lints/cabf_br/lint_dnsname_right_label_valid_tld_test.go index 7aee3f286..b5e24b414 100644 --- a/lints/cabf_br/lint_dnsname_right_label_valid_tld_test.go +++ b/lints/cabf_br/lint_dnsname_right_label_valid_tld_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameValidTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameValidTLD.pem" + inputPath := "dnsNameValidTLD.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameNotValidTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNotValidTLD.pem" + inputPath := "dnsNameNotValidTLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -43,9 +43,9 @@ func TestDNSNameNotValidTLD(t *testing.T) { // with a TLD that was not yet delegated at the time the certificate was issued, // expecting an error. func TestDNSNameNotYetValidTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNotYetValidTLD.pem" + inputPath := "dnsNameNotYetValidTLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -55,9 +55,9 @@ func TestDNSNameNotYetValidTLD(t *testing.T) { // name with a TLD whose delegation was removed from the root DNS at the time // the certificate was issued, expecting an error. func TestDNSNameNoLongerValidTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNoLongerValidTLD.pem" + inputPath := "dnsNameNoLongerValidTLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -67,9 +67,9 @@ func TestDNSNameNoLongerValidTLD(t *testing.T) { // with a TLD whose delegation was removed from the root DNS, but not until // after the certificate was issued, expecting no error. func TestDNSNameWasValidTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWasValidTLD.pem" + inputPath := "dnsNameWasValidTLD.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -80,18 +80,18 @@ func TestDNSNameWasValidTLD(t *testing.T) { // correctly and isn't omitted simply because it is not an ICANN/IANA delegated // TLD. func TestDNSNameOnionTLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameOnionTLD.pem" + inputPath := "dnsNameOnionTLD.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameWithIPInCommonName(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWithIPInCN.pem" + inputPath := "dnsNameWithIPInCN.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_not_valid_tld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_not_valid_tld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_underscore_in_sld_test.go b/lints/cabf_br/lint_dnsname_underscore_in_sld_test.go index 8d8444f36..acd494088 100644 --- a/lints/cabf_br/lint_dnsname_underscore_in_sld_test.go +++ b/lints/cabf_br/lint_dnsname_underscore_in_sld_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameUnderscoreInSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameUnderscoreInSLD.pem" + inputPath := "dnsNameUnderscoreInSLD.pem" expected := lint.Error - out := lint.Lints["e_dnsname_underscore_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_underscore_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameNoUnderscoreInSLD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNoUnderscoreInSLD.pem" + inputPath := "dnsNameNoUnderscoreInSLD.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_underscore_in_sld"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_underscore_in_sld", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_underscore_in_trd_test.go b/lints/cabf_br/lint_dnsname_underscore_in_trd_test.go index 594b52f21..7c0df2a05 100644 --- a/lints/cabf_br/lint_dnsname_underscore_in_trd_test.go +++ b/lints/cabf_br/lint_dnsname_underscore_in_trd_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameUnderscoreInTRD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameUnderscoreInTRD.pem" + inputPath := "dnsNameUnderscoreInTRD.pem" expected := lint.Warn - out := lint.Lints["w_dnsname_underscore_in_trd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_dnsname_underscore_in_trd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameNoUnderscoreInTRD(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameNoUnderscoreInTRD.pem" + inputPath := "dnsNameNoUnderscoreInTRD.pem" expected := lint.Pass - out := lint.Lints["w_dnsname_underscore_in_trd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_dnsname_underscore_in_trd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_wildcard_left_of_public_suffix_test.go b/lints/cabf_br/lint_dnsname_wildcard_left_of_public_suffix_test.go index f41202055..19a10dccd 100644 --- a/lints/cabf_br/lint_dnsname_wildcard_left_of_public_suffix_test.go +++ b/lints/cabf_br/lint_dnsname_wildcard_left_of_public_suffix_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestWildcardLeftOfPublicSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardLeftOfPublicSuffix.pem" + inputPath := "dnsNameWildcardLeftOfPublicSuffix.pem" expected := lint.Warn - out := lint.Lints["w_dnsname_wildcard_left_of_public_suffix"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_dnsname_wildcard_left_of_public_suffix", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestWildcardNotLeftOfPublicSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardNotLeftOfPublicSuffix.pem" + inputPath := "dnsNameWildcardNotLeftOfPublicSuffix.pem" expected := lint.Pass - out := lint.Lints["w_dnsname_wildcard_left_of_public_suffix"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_dnsname_wildcard_left_of_public_suffix", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dnsname_wildcard_only_in_left_label_test.go b/lints/cabf_br/lint_dnsname_wildcard_only_in_left_label_test.go index 0201ecb40..3ed55e7de 100644 --- a/lints/cabf_br/lint_dnsname_wildcard_only_in_left_label_test.go +++ b/lints/cabf_br/lint_dnsname_wildcard_only_in_left_label_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameWildcardOnlyInLeftLabel(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardOnlyInLeftLabel.pem" + inputPath := "dnsNameWildcardOnlyInLeftLabel.pem" expected := lint.Pass - out := lint.Lints["e_dnsname_wildcard_only_in_left_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_wildcard_only_in_left_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDNSNameWildcardNotOnlyInLeftLabel(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameWildcardNotOnlyInLeftLabel.pem" + inputPath := "dnsNameWildcardNotOnlyInLeftLabel.pem" expected := lint.Error - out := lint.Lints["e_dnsname_wildcard_only_in_left_label"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dnsname_wildcard_only_in_left_label", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dsa_correct_order_in_subgroup_test.go b/lints/cabf_br/lint_dsa_correct_order_in_subgroup_test.go index 9b8ec7963..00d6d68a6 100644 --- a/lints/cabf_br/lint_dsa_correct_order_in_subgroup_test.go +++ b/lints/cabf_br/lint_dsa_correct_order_in_subgroup_test.go @@ -20,27 +20,27 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDSACorrectOrderSubgroup(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaCorrectOrderInSubgroup.pem" + inputPath := "dsaCorrectOrderInSubgroup.pem" expected := lint.Pass - out := lint.Lints["e_dsa_correct_order_in_subgroup"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_correct_order_in_subgroup", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDSANotCorrectOrderSubgroup(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaCorrectOrderInSubgroup.pem" - c := util.ReadCertificate(inputPath) + inputPath := "dsaCorrectOrderInSubgroup.pem" + c := test.ReadTestCert(inputPath) dsaKey := c.PublicKey.(*dsa.PublicKey) pMinusOne := big.NewInt(0) pMinusOne.Sub(dsaKey.P, big.NewInt(1)) dsaKey.Y = pMinusOne expected := lint.Error - out := lint.Lints["e_dsa_correct_order_in_subgroup"].Execute(c) + out := test.TestLintCert("e_dsa_correct_order_in_subgroup", c) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dsa_improper_modulus_or_divisor_size_test.go b/lints/cabf_br/lint_dsa_improper_modulus_or_divisor_size_test.go index e9b62e4f3..2076ef2e3 100644 --- a/lints/cabf_br/lint_dsa_improper_modulus_or_divisor_size_test.go +++ b/lints/cabf_br/lint_dsa_improper_modulus_or_divisor_size_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestImproperModulusBadQ(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaBadQLen.pem" + inputPath := "dsaBadQLen.pem" expected := lint.Error - out := lint.Lints["e_dsa_improper_modulus_or_divisor_size"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_improper_modulus_or_divisor_size", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestImproperModulusGoodQ(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaNotShorterThan2048Bits.pem" + inputPath := "dsaNotShorterThan2048Bits.pem" expected := lint.Pass - out := lint.Lints["e_dsa_improper_modulus_or_divisor_size"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_improper_modulus_or_divisor_size", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dsa_shorter_than_2048_bits_test.go b/lints/cabf_br/lint_dsa_shorter_than_2048_bits_test.go index 624a3577f..f05346e1d 100644 --- a/lints/cabf_br/lint_dsa_shorter_than_2048_bits_test.go +++ b/lints/cabf_br/lint_dsa_shorter_than_2048_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDSAShorterThan2048Bits(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaShorterThan2048Bits.pem" + inputPath := "dsaShorterThan2048Bits.pem" expected := lint.Error - out := lint.Lints["e_dsa_shorter_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_shorter_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDSANotShorterThan2048Bits(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaNotShorterThan2048Bits.pem" + inputPath := "dsaNotShorterThan2048Bits.pem" expected := lint.Pass - out := lint.Lints["e_dsa_shorter_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_shorter_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_dsa_unique_correct_representation_test.go b/lints/cabf_br/lint_dsa_unique_correct_representation_test.go index 45aa04262..69272b1da 100644 --- a/lints/cabf_br/lint_dsa_unique_correct_representation_test.go +++ b/lints/cabf_br/lint_dsa_unique_correct_representation_test.go @@ -20,21 +20,21 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDSAUniqueCorrectRepresentation(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaUniqueRep.pem" + inputPath := "dsaUniqueRep.pem" expected := lint.Pass - out := lint.Lints["e_dsa_unique_correct_representation"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_dsa_unique_correct_representation", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestDSANotUniqueCorrectRepresentation(t *testing.T) { - inputPath := "../../testlint/testCerts/dsaUniqueRep.pem" - c := util.ReadCertificate(inputPath) + inputPath := "dsaUniqueRep.pem" + c := test.ReadTestCert(inputPath) // Replace Y with P - 1 dsaKey := c.PublicKey.(*dsa.PublicKey) @@ -44,7 +44,7 @@ func TestDSANotUniqueCorrectRepresentation(t *testing.T) { // Expect failure expected := lint.Error - out := lint.Lints["e_dsa_unique_correct_representation"].Execute(c) + out := test.TestLintCert("e_dsa_unique_correct_representation", c) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ec_improper_curves_test.go b/lints/cabf_br/lint_ec_improper_curves_test.go index d8d577c44..6c5c94ac8 100644 --- a/lints/cabf_br/lint_ec_improper_curves_test.go +++ b/lints/cabf_br/lint_ec_improper_curves_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestECP224(t *testing.T) { - inputPath := "../../testlint/testCerts/ecdsaP224.pem" + inputPath := "ecdsaP224.pem" expected := lint.Error - out := lint.Lints["e_ec_improper_curves"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ec_improper_curves", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestECP256(t *testing.T) { - inputPath := "../../testlint/testCerts/ecdsaP256.pem" + inputPath := "ecdsaP256.pem" expected := lint.Pass - out := lint.Lints["e_ec_improper_curves"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ec_improper_curves", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestECP384(t *testing.T) { - inputPath := "../../testlint/testCerts/ecdsaP384.pem" + inputPath := "ecdsaP384.pem" expected := lint.Pass - out := lint.Lints["e_ec_improper_curves"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ec_improper_curves", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestECP521(t *testing.T) { - inputPath := "../../testlint/testCerts/ecdsaP521.pem" + inputPath := "ecdsaP521.pem" expected := lint.Pass - out := lint.Lints["e_ec_improper_curves"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ec_improper_curves", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ev_business_category_missing_test.go b/lints/cabf_br/lint_ev_business_category_missing_test.go index 9b28df769..4e5113600 100644 --- a/lints/cabf_br/lint_ev_business_category_missing_test.go +++ b/lints/cabf_br/lint_ev_business_category_missing_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEvNoBiz(t *testing.T) { - inputPath := "../../testlint/testCerts/evAllGood.pem" + inputPath := "evAllGood.pem" expected := lint.Error - out := lint.Lints["e_ev_business_category_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_business_category_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ev_country_name_missing_test.go b/lints/cabf_br/lint_ev_country_name_missing_test.go index 19d684fdf..1dd3b8372 100644 --- a/lints/cabf_br/lint_ev_country_name_missing_test.go +++ b/lints/cabf_br/lint_ev_country_name_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEvHasCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/evAllGood.pem" + inputPath := "evAllGood.pem" expected := lint.Pass - out := lint.Lints["e_ev_country_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_country_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEvNoCountry(t *testing.T) { - inputPath := "../../testlint/testCerts/evNoCountry.pem" + inputPath := "evNoCountry.pem" expected := lint.Error - out := lint.Lints["e_ev_country_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_country_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ev_organization_name_missing_test.go b/lints/cabf_br/lint_ev_organization_name_missing_test.go index 9b8a20880..086033207 100644 --- a/lints/cabf_br/lint_ev_organization_name_missing_test.go +++ b/lints/cabf_br/lint_ev_organization_name_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEvHasOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/evAllGood.pem" + inputPath := "evAllGood.pem" expected := lint.Pass - out := lint.Lints["e_ev_organization_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_organization_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEvNoOrg(t *testing.T) { - inputPath := "../../testlint/testCerts/evNoOrg.pem" + inputPath := "evNoOrg.pem" expected := lint.Error - out := lint.Lints["e_ev_organization_name_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_organization_name_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ev_serial_number_missing_test.go b/lints/cabf_br/lint_ev_serial_number_missing_test.go index c6058f178..2ac4c13d3 100644 --- a/lints/cabf_br/lint_ev_serial_number_missing_test.go +++ b/lints/cabf_br/lint_ev_serial_number_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEvHasSN(t *testing.T) { - inputPath := "../../testlint/testCerts/evAllGood.pem" + inputPath := "evAllGood.pem" expected := lint.Pass - out := lint.Lints["e_ev_serial_number_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_serial_number_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEvNoSN(t *testing.T) { - inputPath := "../../testlint/testCerts/evNoSN.pem" + inputPath := "evNoSN.pem" expected := lint.Error - out := lint.Lints["e_ev_serial_number_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_serial_number_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ev_valid_time_too_long_test.go b/lints/cabf_br/lint_ev_valid_time_too_long_test.go index bba590696..aeda2630d 100644 --- a/lints/cabf_br/lint_ev_valid_time_too_long_test.go +++ b/lints/cabf_br/lint_ev_valid_time_too_long_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEvValidTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/evValidTooLong.pem" + inputPath := "evValidTooLong.pem" expected := lint.Error - out := lint.Lints["e_ev_valid_time_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_valid_time_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEvValidNotTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/evValidNotTooLong.pem" + inputPath := "evValidNotTooLong.pem" expected := lint.Pass - out := lint.Lints["e_ev_valid_time_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ev_valid_time_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_contains_reserved_ip_test.go b/lints/cabf_br/lint_ext_san_contains_reserved_ip_test.go index 636a063d9..678f328d7 100644 --- a/lints/cabf_br/lint_ext_san_contains_reserved_ip_test.go +++ b/lints/cabf_br/lint_ext_san_contains_reserved_ip_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANIPReserved(t *testing.T) { - inputPath := "../../testlint/testCerts/SANReservedIP.pem" + inputPath := "SANReservedIP.pem" expected := lint.Error - out := lint.Lints["e_ext_san_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANIPReserved6(t *testing.T) { - inputPath := "../../testlint/testCerts/SANReservedIP6.pem" + inputPath := "SANReservedIP6.pem" expected := lint.Error - out := lint.Lints["e_ext_san_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANIPNotReserved(t *testing.T) { - inputPath := "../../testlint/testCerts/SANValidIP.pem" + inputPath := "SANValidIP.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_critical_with_subject_dn_test.go b/lints/cabf_br/lint_ext_san_critical_with_subject_dn_test.go index dbbfae6cc..c2da3ace7 100644 --- a/lints/cabf_br/lint_ext_san_critical_with_subject_dn_test.go +++ b/lints/cabf_br/lint_ext_san_critical_with_subject_dn_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANCritWithSubjectDn(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCriticalSubjectUncommonOnly.pem" + inputPath := "SANCriticalSubjectUncommonOnly.pem" expected := lint.Warn - out := lint.Lints["w_ext_san_critical_with_subject_dn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_san_critical_with_subject_dn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANNotCritWithSubjectDn(t *testing.T) { - inputPath := "../../testlint/testCerts/indivValGoodAllFields.pem" + inputPath := "indivValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["w_ext_san_critical_with_subject_dn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_san_critical_with_subject_dn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_directory_name_present_test.go b/lints/cabf_br/lint_ext_san_directory_name_present_test.go index 2199f2b2e..1f759f507 100644 --- a/lints/cabf_br/lint_ext_san_directory_name_present_test.go +++ b/lints/cabf_br/lint_ext_san_directory_name_present_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANDirNamePresent2(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDirectoryNameBeginning.pem" + inputPath := "SANDirectoryNameBeginning.pem" expected := lint.Error - out := lint.Lints["e_ext_san_directory_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_directory_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANDirNamePresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDirectoryNameEnd.pem" + inputPath := "SANDirectoryNameEnd.pem" expected := lint.Error - out := lint.Lints["e_ext_san_directory_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_directory_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANDirNameMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_directory_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_directory_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_edi_party_name_present_test.go b/lints/cabf_br/lint_ext_san_edi_party_name_present_test.go index da12e6133..18025ae88 100644 --- a/lints/cabf_br/lint_ext_san_edi_party_name_present_test.go +++ b/lints/cabf_br/lint_ext_san_edi_party_name_present_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANEDIPartyPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANEDIParty.pem" + inputPath := "SANEDIParty.pem" expected := lint.Error - out := lint.Lints["e_ext_san_edi_party_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_edi_party_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANEDIPartyMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANOtherName.pem" + inputPath := "SANOtherName.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_edi_party_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_edi_party_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_missing_test.go b/lints/cabf_br/lint_ext_san_missing_test.go index d5977d805..3d7c285d6 100644 --- a/lints/cabf_br/lint_ext_san_missing_test.go +++ b/lints/cabf_br/lint_ext_san_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNoSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectEmptyNoSAN.pem" + inputPath := "subjectEmptyNoSAN.pem" expected := lint.Error - out := lint.Lints["e_ext_san_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestHasSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_other_name_present_test.go b/lints/cabf_br/lint_ext_san_other_name_present_test.go index 13ba7a3f9..41682e413 100644 --- a/lints/cabf_br/lint_ext_san_other_name_present_test.go +++ b/lints/cabf_br/lint_ext_san_other_name_present_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANOtherNamePresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANOtherName.pem" + inputPath := "SANOtherName.pem" expected := lint.Error - out := lint.Lints["e_ext_san_other_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_other_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANOtherNameMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANEDIParty.pem" + inputPath := "SANEDIParty.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_other_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_other_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_registered_id_present_test.go b/lints/cabf_br/lint_ext_san_registered_id_present_test.go index f89592b44..205d058c5 100644 --- a/lints/cabf_br/lint_ext_san_registered_id_present_test.go +++ b/lints/cabf_br/lint_ext_san_registered_id_present_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANRegIdMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_registered_id_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_registered_id_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANRegIdPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANRegisteredIdBeginning.pem" + inputPath := "SANRegisteredIdBeginning.pem" expected := lint.Error - out := lint.Lints["e_ext_san_registered_id_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_registered_id_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANRegIdPresent2(t *testing.T) { - inputPath := "../../testlint/testCerts/SANRegisteredIdEnd.pem" + inputPath := "SANRegisteredIdEnd.pem" expected := lint.Error - out := lint.Lints["e_ext_san_registered_id_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_registered_id_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_rfc822_name_present_test.go b/lints/cabf_br/lint_ext_san_rfc822_name_present_test.go index b57162c64..b354f0093 100644 --- a/lints/cabf_br/lint_ext_san_rfc822_name_present_test.go +++ b/lints/cabf_br/lint_ext_san_rfc822_name_present_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANEmailPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANRFC822Beginning.pem" + inputPath := "SANRFC822Beginning.pem" expected := lint.Error - out := lint.Lints["e_ext_san_rfc822_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANEmailPresent2(t *testing.T) { - inputPath := "../../testlint/testCerts/SANRFC822End.pem" + inputPath := "SANRFC822End.pem" expected := lint.Error - out := lint.Lints["e_ext_san_rfc822_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANEmailMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_rfc822_name_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_name_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_san_uniform_resource_identifier_present_test.go b/lints/cabf_br/lint_ext_san_uniform_resource_identifier_present_test.go index 88a90144c..eba5aa518 100644 --- a/lints/cabf_br/lint_ext_san_uniform_resource_identifier_present_test.go +++ b/lints/cabf_br/lint_ext_san_uniform_resource_identifier_present_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANURIMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uniform_resource_identifier_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uniform_resource_identifier_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIBeginning.pem" + inputPath := "SANURIBeginning.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uniform_resource_identifier_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uniform_resource_identifier_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIPresent2(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIEnd.pem" + inputPath := "SANURIEnd.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uniform_resource_identifier_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uniform_resource_identifier_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_ext_tor_service_descriptor_hash_invalid_test.go b/lints/cabf_br/lint_ext_tor_service_descriptor_hash_invalid_test.go index e52e75cbf..539cbf3a9 100644 --- a/lints/cabf_br/lint_ext_tor_service_descriptor_hash_invalid_test.go +++ b/lints/cabf_br/lint_ext_tor_service_descriptor_hash_invalid_test.go @@ -1,11 +1,10 @@ package cabf_br import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestTorDescHashInvalid(t *testing.T) { @@ -65,8 +64,7 @@ func TestTorDescHashInvalid(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_ext_tor_service_descriptor_hash_invalid"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_ext_tor_service_descriptor_hash_invalid", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_extra_subject_common_names_test.go b/lints/cabf_br/lint_extra_subject_common_names_test.go index 60cb11980..f0cfbc037 100644 --- a/lints/cabf_br/lint_extra_subject_common_names_test.go +++ b/lints/cabf_br/lint_extra_subject_common_names_test.go @@ -1,11 +1,10 @@ package cabf_br import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExtraSubjectCommonNames(t *testing.T) { @@ -28,8 +27,7 @@ func TestExtraSubjectCommonNames(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["w_extra_subject_common_names"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("w_extra_subject_common_names", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_invalid_certificate_version_test.go b/lints/cabf_br/lint_invalid_certificate_version_test.go index 0bf572858..2937ccad8 100644 --- a/lints/cabf_br/lint_invalid_certificate_version_test.go +++ b/lints/cabf_br/lint_invalid_certificate_version_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertVersion2(t *testing.T) { - inputPath := "../../testlint/testCerts/certVersion2WithExtension.pem" + inputPath := "certVersion2WithExtension.pem" expected := lint.Error - out := lint.Lints["e_invalid_certificate_version"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_invalid_certificate_version", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertVersion3(t *testing.T) { - inputPath := "../../testlint/testCerts/certVersion3NoExtensions.pem" + inputPath := "certVersion3NoExtensions.pem" expected := lint.Pass - out := lint.Lints["e_invalid_certificate_version"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_invalid_certificate_version", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_old_root_ca_rsa_mod_less_than_2048_bits_test.go b/lints/cabf_br/lint_old_root_ca_rsa_mod_less_than_2048_bits_test.go index 3321a4533..dee3aa40c 100644 --- a/lints/cabf_br/lint_old_root_ca_rsa_mod_less_than_2048_bits_test.go +++ b/lints/cabf_br/lint_old_root_ca_rsa_mod_less_than_2048_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestOldRootRsaModSizeSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldRootModTooSmall.pem" + inputPath := "oldRootModTooSmall.pem" expected := lint.Error - out := lint.Lints["e_old_root_ca_rsa_mod_less_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_root_ca_rsa_mod_less_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestOldRootRsaModSizeNotSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldRootModSmall.pem" + inputPath := "oldRootModSmall.pem" expected := lint.Pass - out := lint.Lints["e_old_root_ca_rsa_mod_less_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_root_ca_rsa_mod_less_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_old_sub_ca_rsa_mod_less_than_1024_bits_test.go b/lints/cabf_br/lint_old_sub_ca_rsa_mod_less_than_1024_bits_test.go index a3b5390c0..6f45cd946 100644 --- a/lints/cabf_br/lint_old_sub_ca_rsa_mod_less_than_1024_bits_test.go +++ b/lints/cabf_br/lint_old_sub_ca_rsa_mod_less_than_1024_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestOldCaRsaModSizeSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldSubModTooSmall.pem" + inputPath := "oldSubModTooSmall.pem" expected := lint.Error - out := lint.Lints["e_old_sub_ca_rsa_mod_less_than_1024_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_sub_ca_rsa_mod_less_than_1024_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestOldCaRsaModSizeNotSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldSubModSmall.pem" + inputPath := "oldSubModSmall.pem" expected := lint.Pass - out := lint.Lints["e_old_sub_ca_rsa_mod_less_than_1024_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_sub_ca_rsa_mod_less_than_1024_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_old_sub_cert_rsa_mod_less_than_1024_bits_test.go b/lints/cabf_br/lint_old_sub_cert_rsa_mod_less_than_1024_bits_test.go index 26a6a11c0..3dc80add6 100644 --- a/lints/cabf_br/lint_old_sub_cert_rsa_mod_less_than_1024_bits_test.go +++ b/lints/cabf_br/lint_old_sub_cert_rsa_mod_less_than_1024_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestOldSubCertRsaModSizeSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldSubTooSmall.pem" + inputPath := "oldSubTooSmall.pem" expected := lint.Error - out := lint.Lints["e_old_sub_cert_rsa_mod_less_than_1024_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_sub_cert_rsa_mod_less_than_1024_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestOldSubCertRsaModSizeNotSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/oldSubSmall.pem" + inputPath := "oldSubSmall.pem" expected := lint.Pass - out := lint.Lints["e_old_sub_cert_rsa_mod_less_than_1024_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_old_sub_cert_rsa_mod_less_than_1024_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_public_key_type_not_allowed_test.go b/lints/cabf_br/lint_public_key_type_not_allowed_test.go index a7a429416..b048603c5 100644 --- a/lints/cabf_br/lint_public_key_type_not_allowed_test.go +++ b/lints/cabf_br/lint_public_key_type_not_allowed_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPKTypeUnknown(t *testing.T) { - inputPath := "../../testlint/testCerts/unknownpublickey.pem" + inputPath := "unknownpublickey.pem" expected := lint.Error - out := lint.Lints["e_public_key_type_not_allowed"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_public_key_type_not_allowed", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPKTypeRSA(t *testing.T) { - inputPath := "../../testlint/testCerts/rsawithsha1before2016.pem" + inputPath := "rsawithsha1before2016.pem" expected := lint.Pass - out := lint.Lints["e_public_key_type_not_allowed"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_public_key_type_not_allowed", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPKTypeECDSA(t *testing.T) { - inputPath := "../../testlint/testCerts/ecdsaP256.pem" + inputPath := "ecdsaP256.pem" expected := lint.Pass - out := lint.Lints["e_public_key_type_not_allowed"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_public_key_type_not_allowed", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_root_ca_basic_constraints_path_len_constraint_field_present_test.go b/lints/cabf_br/lint_root_ca_basic_constraints_path_len_constraint_field_present_test.go index 0dc501256..035573a2a 100644 --- a/lints/cabf_br/lint_root_ca_basic_constraints_path_len_constraint_field_present_test.go +++ b/lints/cabf_br/lint_root_ca_basic_constraints_path_len_constraint_field_present_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRootCaMaxLenPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCaMaxPathLenPresent.pem" + inputPath := "rootCaMaxPathLenPresent.pem" expected := lint.Warn - out := lint.Lints["w_root_ca_basic_constraints_path_len_constraint_field_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_root_ca_basic_constraints_path_len_constraint_field_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRootCaMaxLenMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCaMaxPathLenMissing.pem" + inputPath := "rootCaMaxPathLenMissing.pem" expected := lint.Pass - out := lint.Lints["w_root_ca_basic_constraints_path_len_constraint_field_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_root_ca_basic_constraints_path_len_constraint_field_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_root_ca_contains_cert_policy_test.go b/lints/cabf_br/lint_root_ca_contains_cert_policy_test.go index 182b4817b..ec1da8a80 100644 --- a/lints/cabf_br/lint_root_ca_contains_cert_policy_test.go +++ b/lints/cabf_br/lint_root_ca_contains_cert_policy_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRootCACertPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAWithCertPolicy.pem" + inputPath := "rootCAWithCertPolicy.pem" expected := lint.Warn - out := lint.Lints["w_root_ca_contains_cert_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_root_ca_contains_cert_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRootCANoCertPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAValid.pem" + inputPath := "rootCAValid.pem" expected := lint.Pass - out := lint.Lints["w_root_ca_contains_cert_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_root_ca_contains_cert_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_root_ca_extended_key_usage_present_test.go b/lints/cabf_br/lint_root_ca_extended_key_usage_present_test.go index f964aa247..29608524e 100644 --- a/lints/cabf_br/lint_root_ca_extended_key_usage_present_test.go +++ b/lints/cabf_br/lint_root_ca_extended_key_usage_present_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRootCAEKU(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAWithEKU.pem" + inputPath := "rootCAWithEKU.pem" expected := lint.Error - out := lint.Lints["e_root_ca_extended_key_usage_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_extended_key_usage_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRootCANoEKU(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAValid.pem" + inputPath := "rootCAValid.pem" expected := lint.Pass - out := lint.Lints["e_root_ca_extended_key_usage_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_extended_key_usage_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_root_ca_key_usage_must_be_critical_test.go b/lints/cabf_br/lint_root_ca_key_usage_must_be_critical_test.go index fed224e4b..8d25aa9ca 100644 --- a/lints/cabf_br/lint_root_ca_key_usage_must_be_critical_test.go +++ b/lints/cabf_br/lint_root_ca_key_usage_must_be_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRootCAKeyUsageCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAKeyUsagePresent.pem" + inputPath := "rootCAKeyUsagePresent.pem" expected := lint.Pass - out := lint.Lints["e_root_ca_key_usage_must_be_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_key_usage_must_be_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRootCAKeyUsageNotCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAKeyUsageNotCritical.pem" + inputPath := "rootCAKeyUsageNotCritical.pem" expected := lint.Error - out := lint.Lints["e_root_ca_key_usage_must_be_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_key_usage_must_be_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_root_ca_key_usage_present_test.go b/lints/cabf_br/lint_root_ca_key_usage_present_test.go index ea126bc44..73f103b3e 100644 --- a/lints/cabf_br/lint_root_ca_key_usage_present_test.go +++ b/lints/cabf_br/lint_root_ca_key_usage_present_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRootCAKeyUsagePresent(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAKeyUsagePresent.pem" + inputPath := "rootCAKeyUsagePresent.pem" expected := lint.Pass - out := lint.Lints["e_root_ca_key_usage_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_key_usage_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRootCAKeyUsageMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/rootCAKeyUsageMissing.pem" + inputPath := "rootCAKeyUsageMissing.pem" expected := lint.Error - out := lint.Lints["e_root_ca_key_usage_present"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_root_ca_key_usage_present", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_mod_factors_smaller_than_752_bits_test.go b/lints/cabf_br/lint_rsa_mod_factors_smaller_than_752_bits_test.go index e9655ed11..fe66ef6ef 100644 --- a/lints/cabf_br/lint_rsa_mod_factors_smaller_than_752_bits_test.go +++ b/lints/cabf_br/lint_rsa_mod_factors_smaller_than_752_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaModFactorTooSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/evenRsaMod.pem" + inputPath := "evenRsaMod.pem" expected := lint.Warn - out := lint.Lints["w_rsa_mod_factors_smaller_than_752"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_mod_factors_smaller_than_752", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaModFactorNotTooSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/goodRsaExp.pem" + inputPath := "goodRsaExp.pem" expected := lint.Pass - out := lint.Lints["w_rsa_mod_factors_smaller_than_752"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_mod_factors_smaller_than_752", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_mod_less_than_2048_bits_test.go b/lints/cabf_br/lint_rsa_mod_less_than_2048_bits_test.go index 9ca327dc3..298161312 100644 --- a/lints/cabf_br/lint_rsa_mod_less_than_2048_bits_test.go +++ b/lints/cabf_br/lint_rsa_mod_less_than_2048_bits_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaModSizeSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/noRsaLength.pem" + inputPath := "noRsaLength.pem" expected := lint.Error - out := lint.Lints["e_rsa_mod_less_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_mod_less_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaModSizeNotSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/yesRsaLength.pem" + inputPath := "yesRsaLength.pem" expected := lint.Pass - out := lint.Lints["e_rsa_mod_less_than_2048_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_mod_less_than_2048_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_mod_not_odd_test.go b/lints/cabf_br/lint_rsa_mod_not_odd_test.go index d63217627..0b8c6d5b2 100644 --- a/lints/cabf_br/lint_rsa_mod_not_odd_test.go +++ b/lints/cabf_br/lint_rsa_mod_not_odd_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaModEven(t *testing.T) { - inputPath := "../../testlint/testCerts/evenRsaMod.pem" + inputPath := "evenRsaMod.pem" expected := lint.Warn - out := lint.Lints["w_rsa_mod_not_odd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_mod_not_odd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaModOdd(t *testing.T) { - inputPath := "../../testlint/testCerts/oddRsaMod.pem" + inputPath := "oddRsaMod.pem" expected := lint.Pass - out := lint.Lints["w_rsa_mod_not_odd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_mod_not_odd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_public_exponent_not_in_range_test.go b/lints/cabf_br/lint_rsa_public_exponent_not_in_range_test.go index 16191414b..0803b51ae 100644 --- a/lints/cabf_br/lint_rsa_public_exponent_not_in_range_test.go +++ b/lints/cabf_br/lint_rsa_public_exponent_not_in_range_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaExpNotInRange(t *testing.T) { - inputPath := "../../testlint/testCerts/badRsaExp.pem" + inputPath := "badRsaExp.pem" expected := lint.Warn - out := lint.Lints["w_rsa_public_exponent_not_in_range"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_public_exponent_not_in_range", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaExpInRange(t *testing.T) { - inputPath := "../../testlint/testCerts/validRsaExpRange.pem" + inputPath := "validRsaExpRange.pem" expected := lint.Pass - out := lint.Lints["w_rsa_public_exponent_not_in_range"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_rsa_public_exponent_not_in_range", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_public_exponent_not_odd_test.go b/lints/cabf_br/lint_rsa_public_exponent_not_odd_test.go index cbd06d167..d36eccd1a 100644 --- a/lints/cabf_br/lint_rsa_public_exponent_not_odd_test.go +++ b/lints/cabf_br/lint_rsa_public_exponent_not_odd_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaExpEven(t *testing.T) { - inputPath := "../../testlint/testCerts/badRsaExp.pem" + inputPath := "badRsaExp.pem" expected := lint.Error - out := lint.Lints["e_rsa_public_exponent_not_odd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_public_exponent_not_odd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaExpOdd(t *testing.T) { - inputPath := "../../testlint/testCerts/goodRsaExp.pem" + inputPath := "goodRsaExp.pem" expected := lint.Pass - out := lint.Lints["e_rsa_public_exponent_not_odd"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_public_exponent_not_odd", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_rsa_public_exponent_too_small_test.go b/lints/cabf_br/lint_rsa_public_exponent_too_small_test.go index 9d3387f78..bc295efc9 100644 --- a/lints/cabf_br/lint_rsa_public_exponent_too_small_test.go +++ b/lints/cabf_br/lint_rsa_public_exponent_too_small_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaExpTooSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/badRsaExpLength.pem" + inputPath := "badRsaExpLength.pem" expected := lint.Error - out := lint.Lints["e_rsa_public_exponent_too_small"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_public_exponent_too_small", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaExpNotTooSmall(t *testing.T) { - inputPath := "../../testlint/testCerts/goodRsaExpLength.pem" + inputPath := "goodRsaExpLength.pem" expected := lint.Pass - out := lint.Lints["e_rsa_public_exponent_too_small"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_public_exponent_too_small", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_san_dns_name_onion_not_ev_cert_test.go b/lints/cabf_br/lint_san_dns_name_onion_not_ev_cert_test.go index be898c035..7ed1f44ce 100644 --- a/lints/cabf_br/lint_san_dns_name_onion_not_ev_cert_test.go +++ b/lints/cabf_br/lint_san_dns_name_onion_not_ev_cert_test.go @@ -1,11 +1,10 @@ package cabf_br import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestOnionNotEV(t *testing.T) { @@ -35,8 +34,7 @@ func TestOnionNotEV(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_san_dns_name_onion_not_ev_cert"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_san_dns_name_onion_not_ev_cert", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_signature_algorithm_not_supported_test.go b/lints/cabf_br/lint_signature_algorithm_not_supported_test.go index 61cf6d529..c9b8bb7d7 100644 --- a/lints/cabf_br/lint_signature_algorithm_not_supported_test.go +++ b/lints/cabf_br/lint_signature_algorithm_not_supported_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSignatureAlgorithmNotSupported(t *testing.T) { - inputPath := "../../testlint/testCerts/md5WithRSASignatureAlgorithm.pem" + inputPath := "md5WithRSASignatureAlgorithm.pem" expected := lint.Error - out := lint.Lints["e_signature_algorithm_not_supported"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_signature_algorithm_not_supported", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSignatureAlgorithmSHA1Supported(t *testing.T) { - inputPath := "../../testlint/testCerts/sha1WithRSASignatureAlgorithm.pem" + inputPath := "sha1WithRSASignatureAlgorithm.pem" expected := lint.Pass - out := lint.Lints["e_signature_algorithm_not_supported"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_signature_algorithm_not_supported", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSignatureAlgorithmRSAPSSWarn(t *testing.T) { - inputPath := "../../testlint/testCerts/sha256WithRSAPSSSignatureAlgorithm.pem" + inputPath := "sha256WithRSAPSSSignatureAlgorithm.pem" expected := lint.Warn - out := lint.Lints["e_signature_algorithm_not_supported"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_signature_algorithm_not_supported", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_aia_does_not_contain_issuing_ca_url_test.go b/lints/cabf_br/lint_sub_ca_aia_does_not_contain_issuing_ca_url_test.go index 0b11ee223..5f4bcc9a9 100644 --- a/lints/cabf_br/lint_sub_ca_aia_does_not_contain_issuing_ca_url_test.go +++ b/lints/cabf_br/lint_sub_ca_aia_does_not_contain_issuing_ca_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaAiaNoIssuerUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWOcspURL.pem" + inputPath := "subCAWOcspURL.pem" expected := lint.Warn - out := lint.Lints["w_sub_ca_aia_does_not_contain_issuing_ca_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_aia_does_not_contain_issuing_ca_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaAiaHasIssuerUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWBothURL.pem" + inputPath := "subCAWBothURL.pem" expected := lint.Pass - out := lint.Lints["w_sub_ca_aia_does_not_contain_issuing_ca_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_aia_does_not_contain_issuing_ca_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_aia_does_not_contain_ocsp_url_test.go b/lints/cabf_br/lint_sub_ca_aia_does_not_contain_ocsp_url_test.go index 8405867d1..d34d5ee34 100644 --- a/lints/cabf_br/lint_sub_ca_aia_does_not_contain_ocsp_url_test.go +++ b/lints/cabf_br/lint_sub_ca_aia_does_not_contain_ocsp_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaAiaNoOcsp(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWIssuerURL.pem" + inputPath := "subCAWIssuerURL.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_aia_does_not_contain_ocsp_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_does_not_contain_ocsp_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaAiaHasOcsp(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWOcspURL.pem" + inputPath := "subCAWOcspURL.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_aia_does_not_contain_ocsp_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_does_not_contain_ocsp_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_aia_marked_critical_test.go b/lints/cabf_br/lint_sub_ca_aia_marked_critical_test.go index ed977bcd1..b6a22eb97 100644 --- a/lints/cabf_br/lint_sub_ca_aia_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_ca_aia_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCAAIAMarkedCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAAIAMarkedCritical.pem" + inputPath := "subCAAIAMarkedCritical.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCAAIANotMarkedCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAAIANotMarkedCritical.pem" + inputPath := "subCAAIANotMarkedCritical.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_aia_missing_test.go b/lints/cabf_br/lint_sub_ca_aia_missing_test.go index 8976f7ccf..c96c44aca 100644 --- a/lints/cabf_br/lint_sub_ca_aia_missing_test.go +++ b/lints/cabf_br/lint_sub_ca_aia_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaAiaMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAAIAMissing.pem" + inputPath := "subCAAIAMissing.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_aia_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaAiaPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAAIAValid.pem" + inputPath := "subCAAIAValid.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_aia_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_aia_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_certificate_policies_marked_critical_test.go b/lints/cabf_br/lint_sub_ca_certificate_policies_marked_critical_test.go index 1b2def56d..479bbadb1 100644 --- a/lints/cabf_br/lint_sub_ca_certificate_policies_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_ca_certificate_policies_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaPolicyCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWCertPolicyCrit.pem" + inputPath := "subCAWCertPolicyCrit.pem" expected := lint.Warn - out := lint.Lints["w_sub_ca_certificate_policies_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_certificate_policies_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaPolicyNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWCertPolicyNoCrit.pem" + inputPath := "subCAWCertPolicyNoCrit.pem" expected := lint.Pass - out := lint.Lints["w_sub_ca_certificate_policies_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_certificate_policies_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_certificate_policies_missing_test.go b/lints/cabf_br/lint_sub_ca_certificate_policies_missing_test.go index 7e1cbf719..94f8f600e 100644 --- a/lints/cabf_br/lint_sub_ca_certificate_policies_missing_test.go +++ b/lints/cabf_br/lint_sub_ca_certificate_policies_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaPolicyMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNoCertPolicy.pem" + inputPath := "subCAWNoCertPolicy.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_certificate_policies_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_certificate_policies_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaPolicyPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWCertPolicyNoCrit.pem" + inputPath := "subCAWCertPolicyNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_certificate_policies_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_certificate_policies_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_crl_distribution_points_does_not_contain_url_test.go b/lints/cabf_br/lint_sub_ca_crl_distribution_points_does_not_contain_url_test.go index 13370e134..f1e69580f 100644 --- a/lints/cabf_br/lint_sub_ca_crl_distribution_points_does_not_contain_url_test.go +++ b/lints/cabf_br/lint_sub_ca_crl_distribution_points_does_not_contain_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaCrlNoUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCaCrlMissing.pem" + inputPath := "subCaCrlMissing.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_crl_distribution_points_does_not_contain_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_does_not_contain_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaCrlUrlPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCaCrlPresent.pem" + inputPath := "subCaCrlPresent.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_crl_distribution_points_does_not_contain_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_does_not_contain_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_crl_distribution_points_marked_critical_test.go b/lints/cabf_br/lint_sub_ca_crl_distribution_points_marked_critical_test.go index a31716270..3b29daec1 100644 --- a/lints/cabf_br/lint_sub_ca_crl_distribution_points_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_ca_crl_distribution_points_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaCrlCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWcrlDistCrit.pem" + inputPath := "subCAWcrlDistCrit.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_crl_distribution_points_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaCrlNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWcrlDistNoCrit.pem" + inputPath := "subCAWcrlDistNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_crl_distribution_points_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_crl_distribution_points_missing_test.go b/lints/cabf_br/lint_sub_ca_crl_distribution_points_missing_test.go index 235889f0f..b033a965b 100644 --- a/lints/cabf_br/lint_sub_ca_crl_distribution_points_missing_test.go +++ b/lints/cabf_br/lint_sub_ca_crl_distribution_points_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaCrlMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNocrlDist.pem" + inputPath := "subCAWNocrlDist.pem" expected := lint.Error - out := lint.Lints["e_sub_ca_crl_distribution_points_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaCrlPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWcrlDistNoCrit.pem" + inputPath := "subCAWcrlDistNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_ca_crl_distribution_points_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_ca_crl_distribution_points_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_eku_critical_test.go b/lints/cabf_br/lint_sub_ca_eku_critical_test.go index 71a2c70d8..a18cc71c5 100644 --- a/lints/cabf_br/lint_sub_ca_eku_critical_test.go +++ b/lints/cabf_br/lint_sub_ca_eku_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaEkuCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWEkuCrit.pem" + inputPath := "subCAWEkuCrit.pem" expected := lint.Warn - out := lint.Lints["w_sub_ca_eku_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_eku_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaEkuNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWEkuNoCrit.pem" + inputPath := "subCAWEkuNoCrit.pem" expected := lint.Pass - out := lint.Lints["w_sub_ca_eku_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_eku_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_eku_missing_test.go b/lints/cabf_br/lint_sub_ca_eku_missing_test.go index 7a84513fc..32dfa6b32 100644 --- a/lints/cabf_br/lint_sub_ca_eku_missing_test.go +++ b/lints/cabf_br/lint_sub_ca_eku_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaEkuMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAEKUMissing.pem" + inputPath := "subCAEKUMissing.pem" expected := lint.Notice - out := lint.Lints["n_sub_ca_eku_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_sub_ca_eku_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaEkuNotMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWEkuCrit.pem" + inputPath := "subCAWEkuCrit.pem" expected := lint.Pass - out := lint.Lints["n_sub_ca_eku_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_sub_ca_eku_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_eku_valid_fields_test.go b/lints/cabf_br/lint_sub_ca_eku_valid_fields_test.go index 85ed3d1ed..223a60122 100644 --- a/lints/cabf_br/lint_sub_ca_eku_valid_fields_test.go +++ b/lints/cabf_br/lint_sub_ca_eku_valid_fields_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCAEKUValidFields(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAEKUValidFields.pem" + inputPath := "subCAEKUValidFields.pem" expected := lint.Pass - out := lint.Lints["n_sub_ca_eku_not_technically_constrained"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_sub_ca_eku_not_technically_constrained", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCAEKUNotValidFields(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAEKUNotValidFields.pem" + inputPath := "subCAEKUNotValidFields.pem" expected := lint.NA - out := lint.Lints["n_sub_ca_eku_not_technically_constrained"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_sub_ca_eku_not_technically_constrained", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_ca_name_constraints_not_critical_test.go b/lints/cabf_br/lint_sub_ca_name_constraints_not_critical_test.go index d5feed71d..d69cd6931 100644 --- a/lints/cabf_br/lint_sub_ca_name_constraints_not_critical_test.go +++ b/lints/cabf_br/lint_sub_ca_name_constraints_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaNcNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNameConstNoCrit.pem" + inputPath := "subCAWNameConstNoCrit.pem" expected := lint.Warn - out := lint.Lints["w_sub_ca_name_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_name_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaNcCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNameConstCrit.pem" + inputPath := "subCAWNameConstCrit.pem" expected := lint.Pass - out := lint.Lints["w_sub_ca_name_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_ca_name_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_aia_does_not_contain_issuing_ca_url_test.go b/lints/cabf_br/lint_sub_cert_aia_does_not_contain_issuing_ca_url_test.go index 637cac9f7..d1412fd0e 100644 --- a/lints/cabf_br/lint_sub_cert_aia_does_not_contain_issuing_ca_url_test.go +++ b/lints/cabf_br/lint_sub_cert_aia_does_not_contain_issuing_ca_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertNoIssuerUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWOcspURL.pem" + inputPath := "subCertWOcspURL.pem" expected := lint.Warn - out := lint.Lints["w_sub_cert_aia_does_not_contain_issuing_ca_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_aia_does_not_contain_issuing_ca_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertHasIssuerUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWIssuerURL.pem" + inputPath := "subCertWIssuerURL.pem" expected := lint.Pass - out := lint.Lints["w_sub_cert_aia_does_not_contain_issuing_ca_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_aia_does_not_contain_issuing_ca_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_aia_does_not_contain_ocsp_url_test.go b/lints/cabf_br/lint_sub_cert_aia_does_not_contain_ocsp_url_test.go index b224cbfb9..0c3ccd866 100644 --- a/lints/cabf_br/lint_sub_cert_aia_does_not_contain_ocsp_url_test.go +++ b/lints/cabf_br/lint_sub_cert_aia_does_not_contain_ocsp_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertNoIssuerOcsp(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWIssuerURL.pem" + inputPath := "subCertWIssuerURL.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_aia_does_not_contain_ocsp_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_does_not_contain_ocsp_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertHasIssuerOcsp(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWOcspURL.pem" + inputPath := "subCertWOcspURL.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_aia_does_not_contain_ocsp_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_does_not_contain_ocsp_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_aia_marked_critical_test.go b/lints/cabf_br/lint_sub_cert_aia_marked_critical_test.go index d94f4dd7e..4ee04e7f0 100644 --- a/lints/cabf_br/lint_sub_cert_aia_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_cert_aia_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertAiaMarkedCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertAIAMarkedCritical.pem" + inputPath := "subCertAIAMarkedCritical.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertAiaNotMarkedCritical(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertAIANotMarkedCritical.pem" + inputPath := "subCertAIANotMarkedCritical.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_aia_missing_test.go b/lints/cabf_br/lint_sub_cert_aia_missing_test.go index c31ef1484..fc9e004e7 100644 --- a/lints/cabf_br/lint_sub_cert_aia_missing_test.go +++ b/lints/cabf_br/lint_sub_cert_aia_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertAiaMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWNoURL.pem" + inputPath := "subCertWNoURL.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_aia_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertAiaPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertWBothURL.pem" + inputPath := "subCertWBothURL.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_aia_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_aia_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_cert_policy_empty_test.go b/lints/cabf_br/lint_sub_cert_cert_policy_empty_test.go index df58036f1..a1a685d48 100644 --- a/lints/cabf_br/lint_sub_cert_cert_policy_empty_test.go +++ b/lints/cabf_br/lint_sub_cert_cert_policy_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyMissing.pem" + inputPath := "subCertPolicyMissing.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_cert_policy_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_cert_policy_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyNoCrit.pem" + inputPath := "subCertPolicyNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_cert_policy_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_cert_policy_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_certificate_policies_marked_critical_test.go b/lints/cabf_br/lint_sub_cert_certificate_policies_marked_critical_test.go index 98b5c7d2a..29cdaa35e 100644 --- a/lints/cabf_br/lint_sub_cert_certificate_policies_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_cert_certificate_policies_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertPolicyCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyCrit.pem" + inputPath := "subCertPolicyCrit.pem" expected := lint.Warn - out := lint.Lints["w_sub_cert_certificate_policies_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_certificate_policies_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertPolicyNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyNoCrit.pem" + inputPath := "subCertPolicyNoCrit.pem" expected := lint.Pass - out := lint.Lints["w_sub_cert_certificate_policies_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_certificate_policies_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_certificate_policies_missing_test.go b/lints/cabf_br/lint_sub_cert_certificate_policies_missing_test.go index ebe9da356..bc97de779 100644 --- a/lints/cabf_br/lint_sub_cert_certificate_policies_missing_test.go +++ b/lints/cabf_br/lint_sub_cert_certificate_policies_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertPolicyMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyMissing.pem" + inputPath := "subCertPolicyMissing.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_certificate_policies_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_certificate_policies_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertPolicyPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPolicyNoCrit.pem" + inputPath := "subCertPolicyNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_certificate_policies_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_certificate_policies_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_country_name_must_appear_test.go b/lints/cabf_br/lint_sub_cert_country_name_must_appear_test.go index 04929e067..3aa0a8664 100644 --- a/lints/cabf_br/lint_sub_cert_country_name_must_appear_test.go +++ b/lints/cabf_br/lint_sub_cert_country_name_must_appear_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertCountryNameMustAppear(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertCountryNameMustAppear.pem" + inputPath := "subCertCountryNameMustAppear.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_country_name_must_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_country_name_must_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_crl_distribution_points_does_not_contain_url_test.go b/lints/cabf_br/lint_sub_cert_crl_distribution_points_does_not_contain_url_test.go index dfa3c7256..a5de47e90 100644 --- a/lints/cabf_br/lint_sub_cert_crl_distribution_points_does_not_contain_url_test.go +++ b/lints/cabf_br/lint_sub_cert_crl_distribution_points_does_not_contain_url_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCrlNoUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCrlDistNoURL.pem" + inputPath := "subCrlDistNoURL.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_crl_distribution_points_does_not_contain_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_crl_distribution_points_does_not_contain_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCrlContainsUrl(t *testing.T) { - inputPath := "../../testlint/testCerts/subCrlDistURL.pem" + inputPath := "subCrlDistURL.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_crl_distribution_points_does_not_contain_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_crl_distribution_points_does_not_contain_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -46,9 +46,9 @@ func TestCrlContainsUrlInCompoundFullName(t *testing.T) { // interpreted as different names for the same underlying CRL, i.e. // providing an LDAP URI and an HTTP URI -- see section 4.2.1.13 of // lint.RFC5280). - inputPath := "../../testlint/testCerts/subCrlDistURLInCompoundFullName.pem" + inputPath := "subCrlDistURLInCompoundFullName.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_crl_distribution_points_does_not_contain_url"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_crl_distribution_points_does_not_contain_url", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_crl_distribution_points_marked_critical_test.go b/lints/cabf_br/lint_sub_cert_crl_distribution_points_marked_critical_test.go index d01990d4b..9fadd8ad1 100644 --- a/lints/cabf_br/lint_sub_cert_crl_distribution_points_marked_critical_test.go +++ b/lints/cabf_br/lint_sub_cert_crl_distribution_points_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCrlCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCrlDistCrit.pem" + inputPath := "subCrlDistCrit.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_crl_distribution_points_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_crl_distribution_points_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCrlNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCrlDistNoCrit.pem" + inputPath := "subCrlDistNoCrit.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_crl_distribution_points_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_crl_distribution_points_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_eku_extra_values_test.go b/lints/cabf_br/lint_sub_cert_eku_extra_values_test.go index 3b10e2fec..3a85a7ce5 100644 --- a/lints/cabf_br/lint_sub_cert_eku_extra_values_test.go +++ b/lints/cabf_br/lint_sub_cert_eku_extra_values_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEkuExtra(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageServClientEmailCodeSign.pem" + inputPath := "subExtKeyUsageServClientEmailCodeSign.pem" expected := lint.Warn - out := lint.Lints["w_sub_cert_eku_extra_values"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_eku_extra_values", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEkuNoExtra(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageServClientEmail.pem" + inputPath := "subExtKeyUsageServClientEmail.pem" expected := lint.Pass - out := lint.Lints["w_sub_cert_eku_extra_values"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_eku_extra_values", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_eku_missing_test.go b/lints/cabf_br/lint_sub_cert_eku_missing_test.go index 1d0ddf09a..385a03d04 100644 --- a/lints/cabf_br/lint_sub_cert_eku_missing_test.go +++ b/lints/cabf_br/lint_sub_cert_eku_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEkuMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageMissing.pem" + inputPath := "subExtKeyUsageMissing.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_eku_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_eku_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEkuPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageServClient.pem" + inputPath := "subExtKeyUsageServClient.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_eku_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_eku_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_eku_server_auth_client_auth_missing_test.go b/lints/cabf_br/lint_sub_cert_eku_server_auth_client_auth_missing_test.go index 00771d3cd..3f71cd605 100644 --- a/lints/cabf_br/lint_sub_cert_eku_server_auth_client_auth_missing_test.go +++ b/lints/cabf_br/lint_sub_cert_eku_server_auth_client_auth_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEkuBothPres(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageCodeSign.pem" + inputPath := "subExtKeyUsageCodeSign.pem" expected := lint.NA - out := lint.Lints["e_sub_cert_eku_server_auth_client_auth_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_eku_server_auth_client_auth_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEkuNeitherPres(t *testing.T) { - inputPath := "../../testlint/testCerts/subExtKeyUsageServClient.pem" + inputPath := "subExtKeyUsageServClient.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_eku_server_auth_client_auth_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_eku_server_auth_client_auth_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_gn_sn_contains_policy_test.go b/lints/cabf_br/lint_sub_cert_gn_sn_contains_policy_test.go index 36e64b351..7799b1123 100644 --- a/lints/cabf_br/lint_sub_cert_gn_sn_contains_policy_test.go +++ b/lints/cabf_br/lint_sub_cert_gn_sn_contains_policy_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestGivenNameCorrectPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/givenNameCorrectPolicy.pem" + inputPath := "givenNameCorrectPolicy.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_given_name_surname_contains_correct_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_given_name_surname_contains_correct_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSurnameCorrectPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/surnameCorrectPolicy.pem" + inputPath := "surnameCorrectPolicy.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_given_name_surname_contains_correct_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_given_name_surname_contains_correct_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestGivenNameIncorrectPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/givenNameIncorrectPolicy.pem" + inputPath := "givenNameIncorrectPolicy.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_given_name_surname_contains_correct_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_given_name_surname_contains_correct_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSurnameIncorrectPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/surnameIncorrectPolicy.pem" + inputPath := "surnameIncorrectPolicy.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_given_name_surname_contains_correct_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_given_name_surname_contains_correct_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_is_ca_test.go b/lints/cabf_br/lint_sub_cert_is_ca_test.go index 29308bc21..c635e5698 100644 --- a/lints/cabf_br/lint_sub_cert_is_ca_test.go +++ b/lints/cabf_br/lint_sub_cert_is_ca_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertIsNotCA(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertIsNotCA.pem" + inputPath := "subCertIsNotCA.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_not_is_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_not_is_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertIsCA(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertIsCA.pem" + inputPath := "subCertIsCA.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_not_is_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_not_is_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_key_usage_cert_sign_bit_set_test.go b/lints/cabf_br/lint_sub_cert_key_usage_cert_sign_bit_set_test.go index c427bb40c..919bed2b6 100644 --- a/lints/cabf_br/lint_sub_cert_key_usage_cert_sign_bit_set_test.go +++ b/lints/cabf_br/lint_sub_cert_key_usage_cert_sign_bit_set_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertSignBitSet(t *testing.T) { - inputPath := "../../testlint/testCerts/subKeyUsageInvalid.pem" + inputPath := "subKeyUsageInvalid.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_key_usage_cert_sign_bit_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_key_usage_cert_sign_bit_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertSignBitNotSet(t *testing.T) { - inputPath := "../../testlint/testCerts/subKeyUsageValid.pem" + inputPath := "subKeyUsageValid.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_key_usage_cert_sign_bit_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_key_usage_cert_sign_bit_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_key_usage_crl_sign_bit_set_test.go b/lints/cabf_br/lint_sub_cert_key_usage_crl_sign_bit_set_test.go index 83b5b21a0..89e366904 100644 --- a/lints/cabf_br/lint_sub_cert_key_usage_crl_sign_bit_set_test.go +++ b/lints/cabf_br/lint_sub_cert_key_usage_crl_sign_bit_set_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCrlSignBitSet(t *testing.T) { - inputPath := "../../testlint/testCerts/subKeyUsageInvalid.pem" + inputPath := "subKeyUsageInvalid.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_key_usage_crl_sign_bit_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_key_usage_crl_sign_bit_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCrlSignBitNotSet(t *testing.T) { - inputPath := "../../testlint/testCerts/subKeyUsageValid.pem" + inputPath := "subKeyUsageValid.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_key_usage_crl_sign_bit_set"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_key_usage_crl_sign_bit_set", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_locality_name_must_appear_test.go b/lints/cabf_br/lint_sub_cert_locality_name_must_appear_test.go index 42a40d398..569d958ad 100644 --- a/lints/cabf_br/lint_sub_cert_locality_name_must_appear_test.go +++ b/lints/cabf_br/lint_sub_cert_locality_name_must_appear_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertLocalityNameMustAppear(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertLocalityNameMustAppear.pem" + inputPath := "subCertLocalityNameMustAppear.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_locality_name_must_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_locality_name_must_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertLocalityNameDoesNotNeedToAppear(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertLocalityNameDoesNotNeedToAppear.pem" + inputPath := "subCertLocalityNameDoesNotNeedToAppear.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_locality_name_must_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_locality_name_must_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_locality_name_must_not_appear_test.go b/lints/cabf_br/lint_sub_cert_locality_name_must_not_appear_test.go index ed20d7b97..f0f37ea95 100644 --- a/lints/cabf_br/lint_sub_cert_locality_name_must_not_appear_test.go +++ b/lints/cabf_br/lint_sub_cert_locality_name_must_not_appear_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // As a note, these certificates were not built, but instead grabbed from censys.io/query @@ -26,18 +26,18 @@ import ( // select raw, parsed.validity.start from certificates.pemtificates where parsed.signature_algorithm.oid = "1.2.840.113549.1.1.5" limit 200 func TestSubCertLocalityNameProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertLocalityNameProhibited.pem" + inputPath := "subCertLocalityNameProhibited.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_locality_name_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_locality_name_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertLocalityNameNotProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertLocalityNameNotProhibited.pem" + inputPath := "subCertLocalityNameNotProhibited.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_locality_name_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_locality_name_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_or_sub_ca_using_sha1_test.go b/lints/cabf_br/lint_sub_cert_or_sub_ca_using_sha1_test.go index 42ef1c0b5..ff7c92bf9 100644 --- a/lints/cabf_br/lint_sub_cert_or_sub_ca_using_sha1_test.go +++ b/lints/cabf_br/lint_sub_cert_or_sub_ca_using_sha1_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // As a note, these certificates were not built, but instead grabbed from censys.io/query @@ -26,18 +26,18 @@ import ( // select raw, parsed.validity.start from certificates.pemtificates where parsed.signature_algorithm.oid = "1.2.840.113549.1.1.5" limit 200 func TestSHA1After2016(t *testing.T) { - inputPath := "../../testlint/testCerts/rsawithsha1after2016.pem" + inputPath := "rsawithsha1after2016.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_or_sub_ca_using_sha1"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_or_sub_ca_using_sha1", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSHA1Before2016(t *testing.T) { - inputPath := "../../testlint/testCerts/rsawithsha1before2016.pem" + inputPath := "rsawithsha1before2016.pem" expected := lint.NE - out := lint.Lints["e_sub_cert_or_sub_ca_using_sha1"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_or_sub_ca_using_sha1", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_postal_code_prohibited_test.go b/lints/cabf_br/lint_sub_cert_postal_code_prohibited_test.go index b5f18fe03..27e8cb5ca 100644 --- a/lints/cabf_br/lint_sub_cert_postal_code_prohibited_test.go +++ b/lints/cabf_br/lint_sub_cert_postal_code_prohibited_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // As a note, these certificates were not built, but instead grabbed from censys.io/query @@ -26,18 +26,18 @@ import ( // select raw, parsed.validity.start from certificates.pemtificates where parsed.signature_algorithm.oid = "1.2.840.113549.1.1.5" limit 200 func TestSubCertPostalCodeProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertProvinceMustNotAppear.pem" + inputPath := "subCertProvinceMustNotAppear.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_postal_code_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_postal_code_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertPostalCodeNotProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPostalCodeNotProhibited.pem" + inputPath := "subCertPostalCodeNotProhibited.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_postal_code_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_postal_code_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_province_must_appear_test.go b/lints/cabf_br/lint_sub_cert_province_must_appear_test.go index 4848aceb6..4339c5cdd 100644 --- a/lints/cabf_br/lint_sub_cert_province_must_appear_test.go +++ b/lints/cabf_br/lint_sub_cert_province_must_appear_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // As a note, these certificates were not built, but instead grabbed from censys.io/query @@ -26,18 +26,18 @@ import ( // select raw, parsed.validity.start from certificates.pemtificates where parsed.signature_algorithm.oid = "1.2.840.113549.1.1.5" limit 200 func TestSubCertProvinceProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertProvinceProhibited.pem" + inputPath := "subCertProvinceProhibited.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_province_must_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_province_must_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertProvinceNotProhibited(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertProvinceNotProhibited.pem" + inputPath := "subCertProvinceNotProhibited.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_province_must_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_province_must_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_province_must_not_appear_test.go b/lints/cabf_br/lint_sub_cert_province_must_not_appear_test.go index 546327f1f..9db09b573 100644 --- a/lints/cabf_br/lint_sub_cert_province_must_not_appear_test.go +++ b/lints/cabf_br/lint_sub_cert_province_must_not_appear_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // As a note, these certificates were not built, but instead grabbed from censys.io/query @@ -26,18 +26,18 @@ import ( // select raw, parsed.validity.start from certificates.pemtificates where parsed.signature_algorithm.oid = "1.2.840.113549.1.1.5" limit 200 func TestSubCertProvinceMustNotAppear(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertProvinceMustNotAppear.pem" + inputPath := "subCertProvinceMustNotAppear.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_province_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_province_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertProvinceCanAppear(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertProvinceCanAppear.pem" + inputPath := "subCertProvinceCanAppear.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_province_must_not_appear"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_province_must_not_appear", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_sha1_expiration_too_long_test.go b/lints/cabf_br/lint_sub_cert_sha1_expiration_too_long_test.go index 1cf760074..9305a4c44 100644 --- a/lints/cabf_br/lint_sub_cert_sha1_expiration_too_long_test.go +++ b/lints/cabf_br/lint_sub_cert_sha1_expiration_too_long_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRsaSha1TooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/sha1ExpireAfter2017.pem" + inputPath := "sha1ExpireAfter2017.pem" expected := lint.Warn - out := lint.Lints["w_sub_cert_sha1_expiration_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_sha1_expiration_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestRsaSha1NotTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/sha1ExpirePrior2017.pem" + inputPath := "sha1ExpirePrior2017.pem" expected := lint.Pass - out := lint.Lints["w_sub_cert_sha1_expiration_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_sub_cert_sha1_expiration_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_street_address_should_not_exist_test.go b/lints/cabf_br/lint_sub_cert_street_address_should_not_exist_test.go index 75c6c5284..22acf91d0 100644 --- a/lints/cabf_br/lint_sub_cert_street_address_should_not_exist_test.go +++ b/lints/cabf_br/lint_sub_cert_street_address_should_not_exist_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestStreetAddressShouldNotExist(t *testing.T) { - inputPath := "../../testlint/testCerts/streetAddressCannotExist.pem" + inputPath := "streetAddressCannotExist.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_street_address_should_not_exist"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_street_address_should_not_exist", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestStreetAddressCanExist(t *testing.T) { - inputPath := "../../testlint/testCerts/streetAddressCanExist.pem" + inputPath := "streetAddressCanExist.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_street_address_should_not_exist"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_street_address_should_not_exist", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_valid_time_longer_than_39_months_test.go b/lints/cabf_br/lint_sub_cert_valid_time_longer_than_39_months_test.go index 062e1fad9..2e57ac753 100644 --- a/lints/cabf_br/lint_sub_cert_valid_time_longer_than_39_months_test.go +++ b/lints/cabf_br/lint_sub_cert_valid_time_longer_than_39_months_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertValidTimeLongerThan39Months(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertValidTimeTooLong.pem" + inputPath := "subCertValidTimeTooLong.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_valid_time_longer_than_39_months"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_valid_time_longer_than_39_months", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertValidTimeGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertValidTimeGood.pem" + inputPath := "subCertValidTimeGood.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_valid_time_longer_than_39_months"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_valid_time_longer_than_39_months", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_sub_cert_valid_time_longer_than_825_days_test.go b/lints/cabf_br/lint_sub_cert_valid_time_longer_than_825_days_test.go index a3ca77ba0..c66f544d5 100644 --- a/lints/cabf_br/lint_sub_cert_valid_time_longer_than_825_days_test.go +++ b/lints/cabf_br/lint_sub_cert_valid_time_longer_than_825_days_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertValidTimeLongerThan825Days(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertOver825DaysBad.pem" + inputPath := "subCertOver825DaysBad.pem" expected := lint.Error - out := lint.Lints["e_sub_cert_valid_time_longer_than_825_days"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_valid_time_longer_than_825_days", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertValidTimeLongerThan825DaysBeforeCutoff(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertOver825DaysOK.pem" + inputPath := "subCertOver825DaysOK.pem" expected := lint.NE - out := lint.Lints["e_sub_cert_valid_time_longer_than_825_days"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_valid_time_longer_than_825_days", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertValidTime825Days(t *testing.T) { - inputPath := "../../testlint/testCerts/subCert825DaysOK.pem" + inputPath := "subCert825DaysOK.pem" expected := lint.Pass - out := lint.Lints["e_sub_cert_valid_time_longer_than_825_days"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_sub_cert_valid_time_longer_than_825_days", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_subject_common_name_included_test.go b/lints/cabf_br/lint_subject_common_name_included_test.go index 991e35f43..da126c9d1 100644 --- a/lints/cabf_br/lint_subject_common_name_included_test.go +++ b/lints/cabf_br/lint_subject_common_name_included_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCN(t *testing.T) { - inputPath := "../../testlint/testCerts/commonNamesURL.pem" + inputPath := "commonNamesURL.pem" expected := lint.Notice - out := lint.Lints["n_subject_common_name_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_subject_common_name_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNoCN(t *testing.T) { - inputPath := "../../testlint/testCerts/commonNamesGood.pem" + inputPath := "commonNamesGood.pem" expected := lint.Pass - out := lint.Lints["n_subject_common_name_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_subject_common_name_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_subject_common_name_not_from_san_test.go b/lints/cabf_br/lint_subject_common_name_not_from_san_test.go index 4dc3c6d1c..055a96bb8 100644 --- a/lints/cabf_br/lint_subject_common_name_not_from_san_test.go +++ b/lints/cabf_br/lint_subject_common_name_not_from_san_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCnNotFromSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWithMissingCN.pem" + inputPath := "SANWithMissingCN.pem" expected := lint.Error - out := lint.Lints["e_subject_common_name_not_from_san"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_common_name_not_from_san", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCnFromSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANRegisteredIdBeginning.pem" + inputPath := "SANRegisteredIdBeginning.pem" expected := lint.Pass - out := lint.Lints["e_subject_common_name_not_from_san"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_common_name_not_from_san", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANCaseNotMatchingCN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaseNotMatchingCN.pem" + inputPath := "SANCaseNotMatchingCN.pem" expected := lint.Pass - out := lint.Lints["e_subject_common_name_not_from_san"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_common_name_not_from_san", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_subject_contains_malformed_arpa_ip_test.go b/lints/cabf_br/lint_subject_contains_malformed_arpa_ip_test.go index b7cf9df06..b6a5bc2e7 100644 --- a/lints/cabf_br/lint_subject_contains_malformed_arpa_ip_test.go +++ b/lints/cabf_br/lint_subject_contains_malformed_arpa_ip_test.go @@ -1,11 +1,10 @@ package cabf_br import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectMalformedDNSARPA(t *testing.T) { @@ -63,8 +62,7 @@ func TestSubjectMalformedDNSARPA(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["w_subject_contains_malformed_arpa_ip"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("w_subject_contains_malformed_arpa_ip", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_subject_contains_noninformational_value_test.go b/lints/cabf_br/lint_subject_contains_noninformational_value_test.go index b83064a13..4eea8f59e 100644 --- a/lints/cabf_br/lint_subject_contains_noninformational_value_test.go +++ b/lints/cabf_br/lint_subject_contains_noninformational_value_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectInformational(t *testing.T) { @@ -29,19 +29,19 @@ func TestSubjectInformational(t *testing.T) { }{ { name: "simple all legal", - inputPath: "../../testlint/testCerts/legalChar.pem", + inputPath: "legalChar.pem", result: lint.Pass, }, { name: "subject with metadata only", - inputPath: "../../testlint/testCerts/illegalChar.pem", + inputPath: "illegalChar.pem", result: lint.Error, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - out := lint.Lints["e_subject_contains_noninformational_value"].Execute(util.ReadCertificate(tc.inputPath)) + out := test.TestLint("e_subject_contains_noninformational_value", tc.inputPath) if out.Status != tc.result { t.Errorf("%s: expected %s, got %s", tc.inputPath, tc.result, out.Status) } diff --git a/lints/cabf_br/lint_subject_contains_reserved_arpa_ip_test.go b/lints/cabf_br/lint_subject_contains_reserved_arpa_ip_test.go index a49534942..8466813f9 100644 --- a/lints/cabf_br/lint_subject_contains_reserved_arpa_ip_test.go +++ b/lints/cabf_br/lint_subject_contains_reserved_arpa_ip_test.go @@ -1,11 +1,10 @@ package cabf_br import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectReverseDNSARPA(t *testing.T) { @@ -61,8 +60,7 @@ func TestSubjectReverseDNSARPA(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_subject_contains_reserved_arpa_ip"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_subject_contains_reserved_arpa_ip", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/cabf_br/lint_subject_contains_reserved_ip_test.go b/lints/cabf_br/lint_subject_contains_reserved_ip_test.go index 954f0ebf9..2f9033dd7 100644 --- a/lints/cabf_br/lint_subject_contains_reserved_ip_test.go +++ b/lints/cabf_br/lint_subject_contains_reserved_ip_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectIPReserved(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectReservedIP.pem" + inputPath := "subjectReservedIP.pem" expected := lint.Error - out := lint.Lints["e_subject_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectIPReserved6(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectReservedIP6.pem" + inputPath := "subjectReservedIP6.pem" expected := lint.Error - out := lint.Lints["e_subject_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectIPNotReserved(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectGoodIP.pem" + inputPath := "subjectGoodIP.pem" expected := lint.Pass - out := lint.Lints["e_subject_contains_reserved_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_contains_reserved_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_br/lint_subject_country_not_iso_test.go b/lints/cabf_br/lint_subject_country_not_iso_test.go index ce9245699..d3b17db8e 100644 --- a/lints/cabf_br/lint_subject_country_not_iso_test.go +++ b/lints/cabf_br/lint_subject_country_not_iso_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCountryNotIso(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectInvalidCountry.pem" + inputPath := "subjectInvalidCountry.pem" expected := lint.Error - out := lint.Lints["e_subject_country_not_iso"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_country_not_iso", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCountryIsIso(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectValidCountry.pem" + inputPath := "subjectValidCountry.pem" expected := lint.Pass - out := lint.Lints["e_subject_country_not_iso"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_country_not_iso", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/cabf_ev/lint_onion_subject_validity_time_too_large_test.go b/lints/cabf_ev/lint_onion_subject_validity_time_too_large_test.go index 9ac4e51df..3a47e85d9 100644 --- a/lints/cabf_ev/lint_onion_subject_validity_time_too_large_test.go +++ b/lints/cabf_ev/lint_onion_subject_validity_time_too_large_test.go @@ -1,11 +1,10 @@ package cabf_ev import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestTorValidityTooLarge(t *testing.T) { @@ -33,8 +32,7 @@ func TestTorValidityTooLarge(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_onion_subject_validity_time_too_large"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_onion_subject_validity_time_too_large", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/community/lint_ian_bare_wildcard_test.go b/lints/community/lint_ian_bare_wildcard_test.go index 409aa3962..3c9cdcc75 100644 --- a/lints/community/lint_ian_bare_wildcard_test.go +++ b/lints/community/lint_ian_bare_wildcard_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrIANBareWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/IANBareWildcard.pem" + inputPath := "IANBareWildcard.pem" expected := lint.Error - out := lint.Lints["e_ian_bare_wildcard"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_bare_wildcard", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrIANNotBareWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ian_bare_wildcard"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_bare_wildcard", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_ian_dns_name_includes_null_char_test.go b/lints/community/lint_ian_dns_name_includes_null_char_test.go index 82ed5bdae..dc38c511e 100644 --- a/lints/community/lint_ian_dns_name_includes_null_char_test.go +++ b/lints/community/lint_ian_dns_name_includes_null_char_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrIANDNSNull(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSNull.pem" + inputPath := "IANDNSNull.pem" expected := lint.Error - out := lint.Lints["e_ian_dns_name_includes_null_char"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_dns_name_includes_null_char", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrIANDNSNotNull(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ian_dns_name_includes_null_char"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_dns_name_includes_null_char", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_ian_dns_name_starts_with_period_test.go b/lints/community/lint_ian_dns_name_starts_with_period_test.go index d4f0dc8f7..0740f69d8 100644 --- a/lints/community/lint_ian_dns_name_starts_with_period_test.go +++ b/lints/community/lint_ian_dns_name_starts_with_period_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrIANDNSStartsWithPeriod(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSPeriod.pem" + inputPath := "IANDNSPeriod.pem" expected := lint.Error - out := lint.Lints["e_ian_dns_name_starts_with_period"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_dns_name_starts_with_period", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrIANDNSNotPeriod(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ian_dns_name_starts_with_period"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_dns_name_starts_with_period", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_ian_iana_pub_suffix_empty_test.go b/lints/community/lint_ian_iana_pub_suffix_empty_test.go index bbcd0f7ba..ffa12edf1 100644 --- a/lints/community/lint_ian_iana_pub_suffix_empty_test.go +++ b/lints/community/lint_ian_iana_pub_suffix_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANBarePubSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/IANBareSuffix.pem" + inputPath := "IANBareSuffix.pem" expected := lint.Warn - out := lint.Lints["w_ian_iana_pub_suffix_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ian_iana_pub_suffix_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANGoodPubSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/IANGoodSuffix.pem" + inputPath := "IANGoodSuffix.pem" expected := lint.Pass - out := lint.Lints["w_ian_iana_pub_suffix_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ian_iana_pub_suffix_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_ian_wildcard_not_first_test.go b/lints/community/lint_ian_wildcard_not_first_test.go index d96e3d5e6..9c0f55fdc 100644 --- a/lints/community/lint_ian_wildcard_not_first_test.go +++ b/lints/community/lint_ian_wildcard_not_first_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrIANWildcardFirst(t *testing.T) { - inputPath := "../../testlint/testCerts/IANWildcardFirst.pem" + inputPath := "IANWildcardFirst.pem" expected := lint.Error - out := lint.Lints["e_ian_wildcard_not_first"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_wildcard_not_first", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrIANWildcardNotFirst(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ian_wildcard_not_first"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ian_wildcard_not_first", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_is_redacted_cert_test.go b/lints/community/lint_is_redacted_cert_test.go index 66ad9d45c..22ee07d28 100644 --- a/lints/community/lint_is_redacted_cert_test.go +++ b/lints/community/lint_is_redacted_cert_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDNSNameContainsQuestionMark(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNameContainsQuestionMark.pem" + inputPath := "dnsNameContainsQuestionMark.pem" expected := lint.Notice - out := lint.Lints["n_contains_redacted_dnsname"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_contains_redacted_dnsname", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_issuer_dn_leading_whitespace_test.go b/lints/community/lint_issuer_dn_leading_whitespace_test.go index e3c65f41e..cca45e184 100644 --- a/lints/community/lint_issuer_dn_leading_whitespace_test.go +++ b/lints/community/lint_issuer_dn_leading_whitespace_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIssuerDNLeadingSpace(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerDNLeadingSpace.pem" + inputPath := "issuerDNLeadingSpace.pem" expected := lint.Warn - out := lint.Lints["w_issuer_dn_leading_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_issuer_dn_leading_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIssuerDNGood(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["w_issuer_dn_leading_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_issuer_dn_leading_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_issuer_dn_trailing_whitespace_test.go b/lints/community/lint_issuer_dn_trailing_whitespace_test.go index 7a8134a70..687f190a2 100644 --- a/lints/community/lint_issuer_dn_trailing_whitespace_test.go +++ b/lints/community/lint_issuer_dn_trailing_whitespace_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIssuerDNTrailingSpace(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerDNTrailingSpace.pem" + inputPath := "issuerDNTrailingSpace.pem" expected := lint.Warn - out := lint.Lints["w_issuer_dn_trailing_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_issuer_dn_trailing_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIssuerDNGood2(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["w_issuer_dn_trailing_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_issuer_dn_trailing_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_issuer_multiple_rdn_test.go b/lints/community/lint_issuer_multiple_rdn_test.go index c01578e32..c72da0ceb 100644 --- a/lints/community/lint_issuer_multiple_rdn_test.go +++ b/lints/community/lint_issuer_multiple_rdn_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIssuerRDNTwoAttribute(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerRDNTwoAttribute.pem" + inputPath := "issuerRDNTwoAttribute.pem" expected := lint.Warn - out := lint.Lints["w_multiple_issuer_rdn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_multiple_issuer_rdn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIssuerRDNOneAttribute(t *testing.T) { - inputPath := "../../testlint/testCerts/RSASHA1Good.pem" + inputPath := "RSASHA1Good.pem" expected := lint.Pass - out := lint.Lints["w_multiple_issuer_rdn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_multiple_issuer_rdn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_rsa_exp_negative_test.go b/lints/community/lint_rsa_exp_negative_test.go index 49010c9b4..7f84ea0c7 100644 --- a/lints/community/lint_rsa_exp_negative_test.go +++ b/lints/community/lint_rsa_exp_negative_test.go @@ -18,15 +18,15 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) // TODO: There should be a test for negative RSA exp. func TestRsaExpPositive(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_rsa_exp_negative"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_rsa_exp_negative", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_bare_wildcard_test.go b/lints/community/lint_san_bare_wildcard_test.go index 022ccbf43..9600c2629 100644 --- a/lints/community/lint_san_bare_wildcard_test.go +++ b/lints/community/lint_san_bare_wildcard_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrSANBareWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/SANBareWildcard.pem" + inputPath := "SANBareWildcard.pem" expected := lint.Error - out := lint.Lints["e_san_bare_wildcard"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_bare_wildcard", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrSANNotBareWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIValid.pem" + inputPath := "SANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_san_bare_wildcard"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_bare_wildcard", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_dns_name_duplicate_test.go b/lints/community/lint_san_dns_name_duplicate_test.go index 34950a0d0..7b8ea2952 100644 --- a/lints/community/lint_san_dns_name_duplicate_test.go +++ b/lints/community/lint_san_dns_name_duplicate_test.go @@ -18,13 +18,13 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrSANDNSDuplicate(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDNSDuplicate.pem" + inputPath := "SANDNSDuplicate.pem" expected := lint.Notice - out := lint.Lints["n_san_dns_name_duplicate"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_san_dns_name_duplicate", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_dns_name_includes_null_char_test.go b/lints/community/lint_san_dns_name_includes_null_char_test.go index 60c99f0b5..b0f7b3515 100644 --- a/lints/community/lint_san_dns_name_includes_null_char_test.go +++ b/lints/community/lint_san_dns_name_includes_null_char_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrSANDNSNull(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDNSNull.pem" + inputPath := "SANDNSNull.pem" expected := lint.Error - out := lint.Lints["e_san_dns_name_includes_null_char"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_dns_name_includes_null_char", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrSANDNSNotNull(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIValid.pem" + inputPath := "SANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_san_dns_name_includes_null_char"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_dns_name_includes_null_char", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_dns_name_starts_with_period_test.go b/lints/community/lint_san_dns_name_starts_with_period_test.go index 19f7f122e..9e87e78dc 100644 --- a/lints/community/lint_san_dns_name_starts_with_period_test.go +++ b/lints/community/lint_san_dns_name_starts_with_period_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrSANDNSStartsWithPeriod(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDNSPeriod.pem" + inputPath := "SANDNSPeriod.pem" expected := lint.Error - out := lint.Lints["e_san_dns_name_starts_with_period"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_dns_name_starts_with_period", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrSANDNSNotPeriod(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIValid.pem" + inputPath := "SANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_san_dns_name_starts_with_period"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_dns_name_starts_with_period", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_iana_pub_suffix_empty_test.go b/lints/community/lint_san_iana_pub_suffix_empty_test.go index 7e45e95dc..2c44da9b6 100644 --- a/lints/community/lint_san_iana_pub_suffix_empty_test.go +++ b/lints/community/lint_san_iana_pub_suffix_empty_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANBarePubSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/SANBareSuffix.pem" + inputPath := "SANBareSuffix.pem" expected := lint.Warn - out := lint.Lints["w_san_iana_pub_suffix_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_san_iana_pub_suffix_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANBarePrivatePubSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/sanPrivatePublicSuffix.pem" + inputPath := "sanPrivatePublicSuffix.pem" expected := lint.Pass - out := lint.Lints["w_san_iana_pub_suffix_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_san_iana_pub_suffix_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANGoodPubSuffix(t *testing.T) { - inputPath := "../../testlint/testCerts/SANGoodSuffix.pem" + inputPath := "SANGoodSuffix.pem" expected := lint.Pass - out := lint.Lints["w_san_iana_pub_suffix_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_san_iana_pub_suffix_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_san_wildcard_not_first_test.go b/lints/community/lint_san_wildcard_not_first_test.go index b8472e2bd..bcede6779 100644 --- a/lints/community/lint_san_wildcard_not_first_test.go +++ b/lints/community/lint_san_wildcard_not_first_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBrSANWildcardFirst(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWildcardFirst.pem" + inputPath := "SANWildcardFirst.pem" expected := lint.Error - out := lint.Lints["e_san_wildcard_not_first"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_wildcard_not_first", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBrSANWildcardNotFirst(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIValid.pem" + inputPath := "SANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_san_wildcard_not_first"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_san_wildcard_not_first", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_subject_dn_leading_whitespace_test.go b/lints/community/lint_subject_dn_leading_whitespace_test.go index 6df0390b2..e5e8e3787 100644 --- a/lints/community/lint_subject_dn_leading_whitespace_test.go +++ b/lints/community/lint_subject_dn_leading_whitespace_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectDNLeadingSpace(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectDNLeadingSpace.pem" + inputPath := "subjectDNLeadingSpace.pem" expected := lint.Warn - out := lint.Lints["w_subject_dn_leading_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_subject_dn_leading_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectDNGood(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["w_subject_dn_leading_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_subject_dn_leading_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_subject_dn_trailing_whitespace_test.go b/lints/community/lint_subject_dn_trailing_whitespace_test.go index 1b9513818..16b0c132b 100644 --- a/lints/community/lint_subject_dn_trailing_whitespace_test.go +++ b/lints/community/lint_subject_dn_trailing_whitespace_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectDNTrailingSpace(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectDNTrailingSpace.pem" + inputPath := "subjectDNTrailingSpace.pem" expected := lint.Warn - out := lint.Lints["w_subject_dn_trailing_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_subject_dn_trailing_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectDNGood2(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["w_subject_dn_trailing_whitespace"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_subject_dn_trailing_whitespace", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_subject_multiple_rdn_test.go b/lints/community/lint_subject_multiple_rdn_test.go index 1d3fe5bae..6e0d950f4 100644 --- a/lints/community/lint_subject_multiple_rdn_test.go +++ b/lints/community/lint_subject_multiple_rdn_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectRDNTwoAttribute(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectRDNTwoAttribute.pem" + inputPath := "subjectRDNTwoAttribute.pem" expected := lint.Notice - out := lint.Lints["n_multiple_subject_rdn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_multiple_subject_rdn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectRDNOneAttribute(t *testing.T) { - inputPath := "../../testlint/testCerts/RSASHA1Good.pem" + inputPath := "RSASHA1Good.pem" expected := lint.Pass - out := lint.Lints["n_multiple_subject_rdn"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("n_multiple_subject_rdn", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/community/lint_validity_time_not_positive_test.go b/lints/community/lint_validity_time_not_positive_test.go index 14379c26e..ff250c535 100644 --- a/lints/community/lint_validity_time_not_positive_test.go +++ b/lints/community/lint_validity_time_not_positive_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestValidityNegative(t *testing.T) { - inputPath := "../../testlint/testCerts/validityNegative.pem" + inputPath := "validityNegative.pem" expected := lint.Error - out := lint.Lints["e_validity_time_not_positive"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_validity_time_not_positive", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestValidityPositive(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_validity_time_not_positive"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_validity_time_not_positive", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/etsi/lint_qcstatem_etsi_present_qcs_critical_test.go b/lints/etsi/lint_qcstatem_etsi_present_qcs_critical_test.go index 81a869eb8..f1ac89d72 100644 --- a/lints/etsi/lint_qcstatem_etsi_present_qcs_critical_test.go +++ b/lints/etsi/lint_qcstatem_etsi_present_qcs_critical_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiPresentQcsCriticalAgainstQcsTestCerts(t *testing.T) { @@ -28,8 +28,7 @@ func TestEtsiPresentQcsCriticalAgainstQcsTestCerts(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_etsi_present_qcs_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_etsi_present_qcs_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_etsi_type_as_statem_test.go b/lints/etsi/lint_qcstatem_etsi_type_as_statem_test.go index 9e38de6ec..ce4d788ee 100644 --- a/lints/etsi/lint_qcstatem_etsi_type_as_statem_test.go +++ b/lints/etsi/lint_qcstatem_etsi_type_as_statem_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiTypeAsQcStmt(t *testing.T) { @@ -32,8 +32,7 @@ func TestEtsiTypeAsQcStmt(t *testing.T) { "QcStmtEtsiValidCert24.pem": lint.Pass, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_etsi_type_as_statem"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_etsi_type_as_statem", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_mandatory_etsi_statems_test.go b/lints/etsi/lint_qcstatem_mandatory_etsi_statems_test.go index f06d01ecb..10d3b89e6 100644 --- a/lints/etsi/lint_qcstatem_mandatory_etsi_statems_test.go +++ b/lints/etsi/lint_qcstatem_mandatory_etsi_statems_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiMandatoryQcStmts(t *testing.T) { @@ -32,8 +32,7 @@ func TestEtsiMandatoryQcStmts(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_mandatory_etsi_statems"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_mandatory_etsi_statems", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qccompliance_valid_test.go b/lints/etsi/lint_qcstatem_qccompliance_valid_test.go index 8e88fafd5..6aefaf9ce 100644 --- a/lints/etsi/lint_qcstatem_qccompliance_valid_test.go +++ b/lints/etsi/lint_qcstatem_qccompliance_valid_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiQcCompliance(t *testing.T) { @@ -33,8 +33,7 @@ func TestEtsiQcCompliance(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_qccompliance_valid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_qccompliance_valid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qclimitvalue_valid_test.go b/lints/etsi/lint_qcstatem_qclimitvalue_valid_test.go index eadb0968b..b5155a474 100644 --- a/lints/etsi/lint_qcstatem_qclimitvalue_valid_test.go +++ b/lints/etsi/lint_qcstatem_qclimitvalue_valid_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestQcStatemQcLimitValueValid(t *testing.T) { @@ -26,8 +26,7 @@ func TestQcStatemQcLimitValueValid(t *testing.T) { "QcStmtValidLimitValue.pem": lint.Pass, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_qclimitvalue_valid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_qclimitvalue_valid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) @@ -40,8 +39,7 @@ func TestQcStatemQcLimitValueInvalid(t *testing.T) { "QcStmtInvalidLimitValue.pem": lint.Error, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_qclimitvalue_valid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_qclimitvalue_valid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qcpds_lang_case_test.go b/lints/etsi/lint_qcstatem_qcpds_lang_case_test.go index 07f47857d..999f0cc8f 100644 --- a/lints/etsi/lint_qcstatem_qcpds_lang_case_test.go +++ b/lints/etsi/lint_qcstatem_qcpds_lang_case_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiQcPdsLangCase(t *testing.T) { @@ -32,8 +32,7 @@ func TestEtsiQcPdsLangCase(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["w_qcstatem_qcpds_lang_case"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_qcstatem_qcpds_lang_case", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qcpds_valid_test.go b/lints/etsi/lint_qcstatem_qcpds_valid_test.go index cfc2b7489..eef5ba51b 100644 --- a/lints/etsi/lint_qcstatem_qcpds_valid_test.go +++ b/lints/etsi/lint_qcstatem_qcpds_valid_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiQcPds(t *testing.T) { @@ -38,8 +38,7 @@ func TestEtsiQcPds(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_qcpds_valid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_qcpds_valid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qctype_valid_test.go b/lints/etsi/lint_qcstatem_qctype_valid_test.go index b4dfa736d..39d5068bf 100644 --- a/lints/etsi/lint_qcstatem_qctype_valid_test.go +++ b/lints/etsi/lint_qcstatem_qctype_valid_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiQcType(t *testing.T) { @@ -32,8 +32,7 @@ func TestEtsiQcType(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["e_qcstatem_qctype_valid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_qcstatem_qctype_valid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/etsi/lint_qcstatem_qctype_web_test.go b/lints/etsi/lint_qcstatem_qctype_web_test.go index 610fd335a..cf51ac927 100644 --- a/lints/etsi/lint_qcstatem_qctype_web_test.go +++ b/lints/etsi/lint_qcstatem_qctype_web_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEtsiQcTypeWeb(t *testing.T) { @@ -28,8 +28,7 @@ func TestEtsiQcTypeWeb(t *testing.T) { "QcStmtEtsiNoQcStatmentsCert22.pem": lint.NA, } for inputPath, expected := range m { - inputPath = "../../testlint/testCerts/" + inputPath - out := lint.Lints["w_qcstatem_qctype_web"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_qcstatem_qctype_web", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) diff --git a/lints/mozilla/lint_mp_allowed_eku_test.go b/lints/mozilla/lint_mp_allowed_eku_test.go index f9f2a4109..40a8fc47e 100644 --- a/lints/mozilla/lint_mp_allowed_eku_test.go +++ b/lints/mozilla/lint_mp_allowed_eku_test.go @@ -15,11 +15,10 @@ package lints */ import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAllowedEKUs(t *testing.T) { @@ -60,8 +59,7 @@ func TestAllowedEKUs(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["n_mp_allowed_eku"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("n_mp_allowed_eku", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/mozilla/lint_mp_authority_key_identifier_correct_test.go b/lints/mozilla/lint_mp_authority_key_identifier_correct_test.go index 057d4827e..ca6b65513 100644 --- a/lints/mozilla/lint_mp_authority_key_identifier_correct_test.go +++ b/lints/mozilla/lint_mp_authority_key_identifier_correct_test.go @@ -15,11 +15,10 @@ package lints */ import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAuthorityKeyIdentifier(t *testing.T) { @@ -42,8 +41,7 @@ func TestAuthorityKeyIdentifier(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_mp_authority_key_identifier_correct"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_mp_authority_key_identifier_correct", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/mozilla/lint_mp_exponent_cannot_be_one_test.go b/lints/mozilla/lint_mp_exponent_cannot_be_one_test.go index 62b28302b..7cf6ed43f 100644 --- a/lints/mozilla/lint_mp_exponent_cannot_be_one_test.go +++ b/lints/mozilla/lint_mp_exponent_cannot_be_one_test.go @@ -15,11 +15,10 @@ package lints */ import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExponentCannotBeOne(t *testing.T) { @@ -42,8 +41,7 @@ func TestExponentCannotBeOne(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_mp_exponent_cannot_be_one"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_mp_exponent_cannot_be_one", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/mozilla/lint_mp_modulus_must_be_2048_bits_or_more_test.go b/lints/mozilla/lint_mp_modulus_must_be_2048_bits_or_more_test.go index 8e455b6d8..40becba8b 100644 --- a/lints/mozilla/lint_mp_modulus_must_be_2048_bits_or_more_test.go +++ b/lints/mozilla/lint_mp_modulus_must_be_2048_bits_or_more_test.go @@ -15,11 +15,10 @@ package lints */ import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestModulus2048OrMore(t *testing.T) { @@ -42,8 +41,7 @@ func TestModulus2048OrMore(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_mp_modulus_must_be_2048_bits_or_more"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_mp_modulus_must_be_2048_bits_or_more", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/mozilla/lint_mp_modulus_must_be_divisible_by_8_test.go b/lints/mozilla/lint_mp_modulus_must_be_divisible_by_8_test.go index 72b25f8ca..da72cb29f 100644 --- a/lints/mozilla/lint_mp_modulus_must_be_divisible_by_8_test.go +++ b/lints/mozilla/lint_mp_modulus_must_be_divisible_by_8_test.go @@ -15,11 +15,10 @@ package lints */ import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestModulusDivisibleBy8(t *testing.T) { @@ -42,8 +41,7 @@ func TestModulusDivisibleBy8(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.InputFilename) - result := lint.Lints["e_mp_modulus_must_be_divisible_by_8"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_mp_modulus_must_be_divisible_by_8", tc.InputFilename) if result.Status != tc.ExpectedResult { t.Errorf("expected result %v was %v", tc.ExpectedResult, result.Status) } diff --git a/lints/rfc/lint_basic_constraints_not_critical_test.go b/lints/rfc/lint_basic_constraints_not_critical_test.go index 98d848948..2147dbc9b 100644 --- a/lints/rfc/lint_basic_constraints_not_critical_test.go +++ b/lints/rfc/lint_basic_constraints_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestBasicConstNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caBasicConstNotCrit.pem" + inputPath := "caBasicConstNotCrit.pem" expected := lint.Error - out := lint.Lints["e_basic_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_basic_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestBasicConstCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caBasicConstCrit.pem" + inputPath := "caBasicConstCrit.pem" expected := lint.Pass - out := lint.Lints["e_basic_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_basic_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ca_subject_field_empty_test.go b/lints/rfc/lint_ca_subject_field_empty_test.go index 8b5ac7dc1..15990142b 100644 --- a/lints/rfc/lint_ca_subject_field_empty_test.go +++ b/lints/rfc/lint_ca_subject_field_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaSubjectMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caSubjectMissing.pem" + inputPath := "caSubjectMissing.pem" expected := lint.Error - out := lint.Lints["e_ca_subject_field_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_subject_field_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaSubjectValid(t *testing.T) { - inputPath := "../../testlint/testCerts/caValCountry.pem" + inputPath := "caValCountry.pem" expected := lint.Pass - out := lint.Lints["e_ca_subject_field_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ca_subject_field_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_cert_contains_unique_identifier_test.go b/lints/rfc/lint_cert_contains_unique_identifier_test.go index 447ff970e..792020588 100644 --- a/lints/rfc/lint_cert_contains_unique_identifier_test.go +++ b/lints/rfc/lint_cert_contains_unique_identifier_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestUIDPresentIssuer(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerUID.pem" + inputPath := "issuerUID.pem" expected := lint.Error - out := lint.Lints["e_cert_contains_unique_identifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_contains_unique_identifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUIDPresentSubject(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectUID.pem" + inputPath := "subjectUID.pem" expected := lint.Error - out := lint.Lints["e_cert_contains_unique_identifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_contains_unique_identifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUIDMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_cert_contains_unique_identifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_contains_unique_identifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_cert_extensions_version_not_3_test.go b/lints/rfc/lint_cert_extensions_version_not_3_test.go index ab4edfc3e..c6f88f77f 100644 --- a/lints/rfc/lint_cert_extensions_version_not_3_test.go +++ b/lints/rfc/lint_cert_extensions_version_not_3_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExtsV2(t *testing.T) { - inputPath := "../../testlint/testCerts/certVersion2WithExtension.pem" + inputPath := "certVersion2WithExtension.pem" expected := lint.Error - out := lint.Lints["e_cert_extensions_version_not_3"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_extensions_version_not_3", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExtsV3(t *testing.T) { - inputPath := "../../testlint/testCerts/caBasicConstCrit.pem" + inputPath := "caBasicConstCrit.pem" expected := lint.Pass - out := lint.Lints["e_cert_extensions_version_not_3"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_extensions_version_not_3", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNoExtsV2(t *testing.T) { - inputPath := "../../testlint/testCerts/certVersion2NoExtensions.pem" + inputPath := "certVersion2NoExtensions.pem" expected := lint.Pass - out := lint.Lints["e_cert_extensions_version_not_3"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_extensions_version_not_3", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_cert_unique_identifier_version_not_2_or_3_test.go b/lints/rfc/lint_cert_unique_identifier_version_not_2_or_3_test.go index c5f786993..58ce1b649 100644 --- a/lints/rfc/lint_cert_unique_identifier_version_not_2_or_3_test.go +++ b/lints/rfc/lint_cert_unique_identifier_version_not_2_or_3_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestUniqueIdVersionNot1(t *testing.T) { - inputPath := "../../testlint/testCerts/uniqueIdVersion3.pem" + inputPath := "uniqueIdVersion3.pem" expected := lint.Pass - out := lint.Lints["e_cert_unique_identifier_version_not_2_or_3"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_unique_identifier_version_not_2_or_3", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUniqueIdVersion1(t *testing.T) { - inputPath := "../../testlint/testCerts/uniqueIdVersion1.pem" + inputPath := "uniqueIdVersion1.pem" expected := lint.Error - out := lint.Lints["e_cert_unique_identifier_version_not_2_or_3"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_cert_unique_identifier_version_not_2_or_3", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_distribution_point_incomplete_test.go b/lints/rfc/lint_distribution_point_incomplete_test.go index 3188a7235..332690b74 100644 --- a/lints/rfc/lint_distribution_point_incomplete_test.go +++ b/lints/rfc/lint_distribution_point_incomplete_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCRLCompleteDp(t *testing.T) { - inputPath := "../../testlint/testCerts/crlComlepteDp.pem" + inputPath := "crlComlepteDp.pem" expected := lint.Pass - out := lint.Lints["e_distribution_point_incomplete"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_distribution_point_incomplete", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCRLIncompleteDp(t *testing.T) { - inputPath := "../../testlint/testCerts/crlIncomlepteDp.pem" + inputPath := "crlIncomlepteDp.pem" expected := lint.Error - out := lint.Lints["e_distribution_point_incomplete"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_distribution_point_incomplete", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_distribution_point_missing_ldap_or_uri_test.go b/lints/rfc/lint_distribution_point_missing_ldap_or_uri_test.go index a9a81b373..d7c2c9121 100644 --- a/lints/rfc/lint_distribution_point_missing_ldap_or_uri_test.go +++ b/lints/rfc/lint_distribution_point_missing_ldap_or_uri_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCRLDistNoHttp(t *testing.T) { - inputPath := "../../testlint/testCerts/crlDistribNoHTTP.pem" + inputPath := "crlDistribNoHTTP.pem" expected := lint.Warn - out := lint.Lints["w_distribution_point_missing_ldap_or_uri"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_distribution_point_missing_ldap_or_uri", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCRLDistHttp(t *testing.T) { - inputPath := "../../testlint/testCerts/crlDistribWithHTTP.pem" + inputPath := "crlDistribWithHTTP.pem" expected := lint.Pass - out := lint.Lints["w_distribution_point_missing_ldap_or_uri"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_distribution_point_missing_ldap_or_uri", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCRLDistLdap(t *testing.T) { - inputPath := "../../testlint/testCerts/crlDistribWithLDAP.pem" + inputPath := "crlDistribWithLDAP.pem" expected := lint.Pass - out := lint.Lints["w_distribution_point_missing_ldap_or_uri"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_distribution_point_missing_ldap_or_uri", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ecdsa_ee_invalid_ku_test.go b/lints/rfc/lint_ecdsa_ee_invalid_ku_test.go index 0e4765d17..5c09d5a34 100644 --- a/lints/rfc/lint_ecdsa_ee_invalid_ku_test.go +++ b/lints/rfc/lint_ecdsa_ee_invalid_ku_test.go @@ -1,11 +1,10 @@ package rfc import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestECDSAInvalidKU(t *testing.T) { @@ -40,8 +39,7 @@ func TestECDSAInvalidKU(t *testing.T) { } for _, tc := range testCases { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.filename) - result := lint.Lints["n_ecdsa_ee_invalid_ku"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("n_ecdsa_ee_invalid_ku", tc.filename) if result.Status != tc.expectedStatus { t.Errorf("expected result %v. actual result was %v", tc.expectedStatus, result.Status) diff --git a/lints/rfc/lint_eku_critical_improperly_test.go b/lints/rfc/lint_eku_critical_improperly_test.go index 8ad954e09..7c61671c4 100644 --- a/lints/rfc/lint_eku_critical_improperly_test.go +++ b/lints/rfc/lint_eku_critical_improperly_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestEKUAnyCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/ekuAnyCrit.pem" + inputPath := "ekuAnyCrit.pem" expected := lint.Warn - out := lint.Lints["w_eku_critical_improperly"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_eku_critical_improperly", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEKUNoCritWAny(t *testing.T) { - inputPath := "../../testlint/testCerts/ekuAnyNoCrit.pem" + inputPath := "ekuAnyNoCrit.pem" expected := lint.Pass - out := lint.Lints["w_eku_critical_improperly"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_eku_critical_improperly", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestEKUNoAnyCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/ekuNoAnyCrit.pem" + inputPath := "ekuNoAnyCrit.pem" expected := lint.Pass - out := lint.Lints["w_eku_critical_improperly"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_eku_critical_improperly", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_aia_access_location_missing_test.go b/lints/rfc/lint_ext_aia_access_location_missing_test.go index 9d69a6102..851a6492e 100644 --- a/lints/rfc/lint_ext_aia_access_location_missing_test.go +++ b/lints/rfc/lint_ext_aia_access_location_missing_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAIAcaIssuerMissingHTTPorLDAP(t *testing.T) { - inputPath := "../../testlint/testCerts/caIssuerNoHTTPLDAP.pem" + inputPath := "caIssuerNoHTTPLDAP.pem" expected := lint.Warn - out := lint.Lints["w_ext_aia_access_location_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_aia_access_location_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAIAcaIssuerHTTP(t *testing.T) { - inputPath := "../../testlint/testCerts/caIssuerHTTP.pem" + inputPath := "caIssuerHTTP.pem" expected := lint.Pass - out := lint.Lints["w_ext_aia_access_location_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_aia_access_location_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAIAcaIssuerLDAP(t *testing.T) { - inputPath := "../../testlint/testCerts/caIssuerLDAP.pem" + inputPath := "caIssuerLDAP.pem" expected := lint.Pass - out := lint.Lints["w_ext_aia_access_location_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_aia_access_location_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAIAcaIssuerBlank(t *testing.T) { - inputPath := "../../testlint/testCerts/caIssuerBlank.pem" + inputPath := "caIssuerBlank.pem" expected := lint.NA - out := lint.Lints["w_ext_aia_access_location_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_aia_access_location_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_aia_marked_critical_test.go b/lints/rfc/lint_ext_aia_marked_critical_test.go index e332f1da0..cebcc2510 100644 --- a/lints/rfc/lint_ext_aia_marked_critical_test.go +++ b/lints/rfc/lint_ext_aia_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAiaCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/aiaCrit.pem" + inputPath := "aiaCrit.pem" expected := lint.Error - out := lint.Lints["e_ext_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAiaNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAAIAValid.pem" + inputPath := "subCAAIAValid.pem" expected := lint.Pass - out := lint.Lints["e_ext_aia_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_aia_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_authority_key_identifier_critical_test.go b/lints/rfc/lint_ext_authority_key_identifier_critical_test.go index 42c4a4348..12b7d4b2d 100644 --- a/lints/rfc/lint_ext_authority_key_identifier_critical_test.go +++ b/lints/rfc/lint_ext_authority_key_identifier_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAKICrit(t *testing.T) { - inputPath := "../../testlint/testCerts/akiCritical.pem" + inputPath := "akiCritical.pem" expected := lint.Error - out := lint.Lints["e_ext_authority_key_identifier_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAKINoCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_authority_key_identifier_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_authority_key_identifier_missing_test.go b/lints/rfc/lint_ext_authority_key_identifier_missing_test.go index f8586c0b7..c72d34c02 100644 --- a/lints/rfc/lint_ext_authority_key_identifier_missing_test.go +++ b/lints/rfc/lint_ext_authority_key_identifier_missing_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAKIMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/akiMissing.pem" + inputPath := "akiMissing.pem" expected := lint.Error - out := lint.Lints["e_ext_authority_key_identifier_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAKIPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_authority_key_identifier_missing"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_missing", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_authority_key_identifier_no_key_identifier_test.go b/lints/rfc/lint_ext_authority_key_identifier_no_key_identifier_test.go index 76cf808a3..71c1528ff 100644 --- a/lints/rfc/lint_ext_authority_key_identifier_no_key_identifier_test.go +++ b/lints/rfc/lint_ext_authority_key_identifier_no_key_identifier_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestAuthorityKeyIdNoKeyIdField(t *testing.T) { - inputPath := "../../testlint/testCerts/akidNoKeyIdentifier.pem" + inputPath := "akidNoKeyIdentifier.pem" expected := lint.Error - out := lint.Lints["e_ext_authority_key_identifier_no_key_identifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_no_key_identifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestAuthorityKeyIdYesKeyIdField(t *testing.T) { - inputPath := "../../testlint/testCerts/akidWithKeyID.pem" + inputPath := "akidWithKeyID.pem" expected := lint.Pass - out := lint.Lints["e_ext_authority_key_identifier_no_key_identifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_authority_key_identifier_no_key_identifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_contains_noticeref_test.go b/lints/rfc/lint_ext_cert_policy_contains_noticeref_test.go index afca30697..fd2b051c4 100644 --- a/lints/rfc/lint_ext_cert_policy_contains_noticeref_test.go +++ b/lints/rfc/lint_ext_cert_policy_contains_noticeref_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNoticeRefUsed(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticePres.pem" + inputPath := "userNoticePres.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_contains_noticeref"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_contains_noticeref", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNoticeRefNotUsed(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeMissing.pem" + inputPath := "userNoticeMissing.pem" expected := lint.Pass - out := lint.Lints["w_ext_cert_policy_contains_noticeref"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_contains_noticeref", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_disallowed_any_policy_qualifier_test.go b/lints/rfc/lint_ext_cert_policy_disallowed_any_policy_qualifier_test.go index 46216cfde..15db3a35b 100644 --- a/lints/rfc/lint_ext_cert_policy_disallowed_any_policy_qualifier_test.go +++ b/lints/rfc/lint_ext_cert_policy_disallowed_any_policy_qualifier_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNoticeRef(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticePres.pem" + inputPath := "userNoticePres.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_disallowed_any_policy_qualifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_disallowed_any_policy_qualifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCps(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeMissing.pem" + inputPath := "userNoticeMissing.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_disallowed_any_policy_qualifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_disallowed_any_policy_qualifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNoticeRefUnknown(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeUnrecommended.pem" + inputPath := "userNoticeUnrecommended.pem" expected := lint.Error - out := lint.Lints["e_ext_cert_policy_disallowed_any_policy_qualifier"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_disallowed_any_policy_qualifier", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_duplicate_test.go b/lints/rfc/lint_ext_cert_policy_duplicate_test.go index 64cc04119..cfdc333e5 100644 --- a/lints/rfc/lint_ext_cert_policy_duplicate_test.go +++ b/lints/rfc/lint_ext_cert_policy_duplicate_test.go @@ -18,30 +18,30 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertPolicyDuplicated(t *testing.T) { - inputPath := "../../testlint/testCerts/certPolicyDuplicateShort.pem" + inputPath := "certPolicyDuplicateShort.pem" expected := lint.Error - out := lint.Lints["e_ext_cert_policy_duplicate"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_duplicate", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyDuplicatedAssertion(t *testing.T) { - inputPath := "../../testlint/testCerts/certPolicyAssertionDuplicated.pem" + inputPath := "certPolicyAssertionDuplicated.pem" expected := lint.Error - out := lint.Lints["e_ext_cert_policy_duplicate"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_duplicate", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertPolicyNotDuplicated(t *testing.T) { - inputPath := "../../testlint/testCerts/certPolicyNoDuplicate.pem" + inputPath := "certPolicyNoDuplicate.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_duplicate"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_duplicate", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_explicit_text_ia5_string_test.go b/lints/rfc/lint_ext_cert_policy_explicit_text_ia5_string_test.go index 596142176..f24c9d956 100644 --- a/lints/rfc/lint_ext_cert_policy_explicit_text_ia5_string_test.go +++ b/lints/rfc/lint_ext_cert_policy_explicit_text_ia5_string_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExplicitTextIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticePres.pem" + inputPath := "userNoticePres.pem" expected := lint.Error - out := lint.Lints["e_ext_cert_policy_explicit_text_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextNotIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeExpTextNotIA5String.pem" + inputPath := "userNoticeExpTextNotIA5String.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_explicit_text_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextNotPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeMissing.pem" + inputPath := "userNoticeMissing.pem" expected := lint.NA - out := lint.Lints["e_ext_cert_policy_explicit_text_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextNotPresent2(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeUnrecommended.pem" + inputPath := "userNoticeUnrecommended.pem" expected := lint.NA - out := lint.Lints["e_ext_cert_policy_explicit_text_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_explicit_text_includes_control_test.go b/lints/rfc/lint_ext_cert_policy_explicit_text_includes_control_test.go index 1a5a675f6..2bb0355fe 100644 --- a/lints/rfc/lint_ext_cert_policy_explicit_text_includes_control_test.go +++ b/lints/rfc/lint_ext_cert_policy_explicit_text_includes_control_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExplicitTextUtfControlX10(t *testing.T) { - inputPath := "../../testlint/testCerts/utf8ControlX10.pem" + inputPath := "utf8ControlX10.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_explicit_text_includes_control"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_includes_control", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextUtfControlX88(t *testing.T) { - inputPath := "../../testlint/testCerts/utf8ControlX88.pem" + inputPath := "utf8ControlX88.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_explicit_text_includes_control"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_includes_control", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextUtfNoControl(t *testing.T) { - inputPath := "../../testlint/testCerts/utf8NoControl.pem" + inputPath := "utf8NoControl.pem" expected := lint.Pass - out := lint.Lints["w_ext_cert_policy_explicit_text_includes_control"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_includes_control", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_explicit_text_not_nfc_test.go b/lints/rfc/lint_ext_cert_policy_explicit_text_not_nfc_test.go index 43ad00989..15706c585 100644 --- a/lints/rfc/lint_ext_cert_policy_explicit_text_not_nfc_test.go +++ b/lints/rfc/lint_ext_cert_policy_explicit_text_not_nfc_test.go @@ -18,40 +18,40 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExplicitTextUtf8NFC(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeExpTextUtf8.pem" + inputPath := "userNoticeExpTextUtf8.pem" expected := lint.Pass - out := lint.Lints["w_ext_cert_policy_explicit_text_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextUtf8NotNFC(t *testing.T) { - inputPath := "../../testlint/testCerts/explicitTextUtf8NotNFC.pem" + inputPath := "explicitTextUtf8NotNFC.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_explicit_text_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextBMPNFC(t *testing.T) { - inputPath := "../../testlint/testCerts/explicitTextBMPNFC.pem" + inputPath := "explicitTextBMPNFC.pem" expected := lint.Pass - out := lint.Lints["w_ext_cert_policy_explicit_text_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextBMPNotNFC(t *testing.T) { - inputPath := "../../testlint/testCerts/explicitTextBMPNotNFC.pem" + inputPath := "explicitTextBMPNotNFC.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_explicit_text_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_explicit_text_not_utf8_test.go b/lints/rfc/lint_ext_cert_policy_explicit_text_not_utf8_test.go index b4277fb29..82edae33e 100644 --- a/lints/rfc/lint_ext_cert_policy_explicit_text_not_utf8_test.go +++ b/lints/rfc/lint_ext_cert_policy_explicit_text_not_utf8_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExplicitTextNotUtf8(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticePres.pem" + inputPath := "userNoticePres.pem" expected := lint.Warn - out := lint.Lints["w_ext_cert_policy_explicit_text_not_utf8"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_utf8", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextNotPresentUtf8(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeMissing.pem" + inputPath := "userNoticeMissing.pem" expected := lint.NA - out := lint.Lints["w_ext_cert_policy_explicit_text_not_utf8"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_utf8", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextUtf8(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeExpTextUtf8.pem" + inputPath := "userNoticeExpTextUtf8.pem" expected := lint.Pass - out := lint.Lints["w_ext_cert_policy_explicit_text_not_utf8"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_cert_policy_explicit_text_not_utf8", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_cert_policy_explicit_text_too_long_test.go b/lints/rfc/lint_ext_cert_policy_explicit_text_too_long_test.go index f5fe656e2..6ed4c6c3a 100644 --- a/lints/rfc/lint_ext_cert_policy_explicit_text_too_long_test.go +++ b/lints/rfc/lint_ext_cert_policy_explicit_text_too_long_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestExplicitText200Char(t *testing.T) { - inputPath := "../../testlint/testCerts/explicitText200Char.pem" + inputPath := "explicitText200Char.pem" expected := lint.Error - out := lint.Lints["e_ext_cert_policy_explicit_text_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitTextBMPString(t *testing.T) { - inputPath := "../../testlint/testCerts/explicitTextBMPString.pem" + inputPath := "explicitTextBMPString.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_explicit_text_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestExplicitText7Char(t *testing.T) { - inputPath := "../../testlint/testCerts/userNoticeExpTextUtf8.pem" + inputPath := "userNoticeExpTextUtf8.pem" expected := lint.Pass - out := lint.Lints["e_ext_cert_policy_explicit_text_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_cert_policy_explicit_text_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_crl_distribution_marked_critical_test.go b/lints/rfc/lint_ext_crl_distribution_marked_critical_test.go index 88649ecec..2b66ed622 100644 --- a/lints/rfc/lint_ext_crl_distribution_marked_critical_test.go +++ b/lints/rfc/lint_ext_crl_distribution_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCRLDistribCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWcrlDistCrit.pem" + inputPath := "subCAWcrlDistCrit.pem" expected := lint.Warn - out := lint.Lints["w_ext_crl_distribution_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_crl_distribution_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCRLDistribNoCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWcrlDistNoCrit.pem" + inputPath := "subCAWcrlDistNoCrit.pem" expected := lint.Pass - out := lint.Lints["w_ext_crl_distribution_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_crl_distribution_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_duplicate_extension_test.go b/lints/rfc/lint_ext_duplicate_extension_test.go index df6d0c69b..c68a177c5 100644 --- a/lints/rfc/lint_ext_duplicate_extension_test.go +++ b/lints/rfc/lint_ext_duplicate_extension_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestDuplicateExtension(t *testing.T) { - inputPath := "../../testlint/testCerts/extSANDuplicated.pem" + inputPath := "extSANDuplicated.pem" expected := lint.Error - out := lint.Lints["e_ext_duplicate_extension"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_duplicate_extension", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNoDuplicateExtension(t *testing.T) { - inputPath := "../../testlint/testCerts/caBasicConstCrit.pem" + inputPath := "caBasicConstCrit.pem" expected := lint.Pass - out := lint.Lints["e_ext_duplicate_extension"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_duplicate_extension", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_freshest_crl_marked_critical_test.go b/lints/rfc/lint_ext_freshest_crl_marked_critical_test.go index 655cdf00c..7e6ed6c0c 100644 --- a/lints/rfc/lint_ext_freshest_crl_marked_critical_test.go +++ b/lints/rfc/lint_ext_freshest_crl_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestFreshestCrlCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/frshCRLCritical.pem" + inputPath := "frshCRLCritical.pem" expected := lint.Error - out := lint.Lints["e_ext_freshest_crl_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_freshest_crl_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestFreshestCrlNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/frshCRLNotCritical.pem" + inputPath := "frshCRLNotCritical.pem" expected := lint.Pass - out := lint.Lints["e_ext_freshest_crl_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_freshest_crl_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_critical_test.go b/lints/rfc/lint_ext_ian_critical_test.go index 3339d8346..d10a31e74 100644 --- a/lints/rfc/lint_ext_ian_critical_test.go +++ b/lints/rfc/lint_ext_ian_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/IANCritical.pem" + inputPath := "IANCritical.pem" expected := lint.Warn - out := lint.Lints["w_ext_ian_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_ian_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/IANNotCritical.pem" + inputPath := "IANNotCritical.pem" expected := lint.Pass - out := lint.Lints["w_ext_ian_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_ian_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_dns_not_ia5_string_test.go b/lints/rfc/lint_ext_ian_dns_not_ia5_string_test.go index 11806b157..4cec5ac37 100644 --- a/lints/rfc/lint_ext_ian_dns_not_ia5_string_test.go +++ b/lints/rfc/lint_ext_ian_dns_not_ia5_string_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANDNSIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSIA5String.pem" + inputPath := "IANDNSIA5String.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_dns_not_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_dns_not_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANDNSNotIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSNotIA5String.pem" + inputPath := "IANDNSNotIA5String.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_dns_not_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_dns_not_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_empty_name_test.go b/lints/rfc/lint_ext_ian_empty_name_test.go index f7fd239a7..a5ec505e7 100644 --- a/lints/rfc/lint_ext_ian_empty_name_test.go +++ b/lints/rfc/lint_ext_ian_empty_name_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANEmptyName(t *testing.T) { - inputPath := "../../testlint/testCerts/IANEmptyName.pem" + inputPath := "IANEmptyName.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_empty_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_empty_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANNotEmptyName(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSIA5String.pem" + inputPath := "IANDNSIA5String.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_empty_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_empty_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_no_entries_test.go b/lints/rfc/lint_ext_ian_no_entries_test.go index 50205ee6d..6691471f1 100644 --- a/lints/rfc/lint_ext_ian_no_entries_test.go +++ b/lints/rfc/lint_ext_ian_no_entries_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANNoEntry(t *testing.T) { - inputPath := "../../testlint/testCerts/IANEmpty.pem" + inputPath := "IANEmpty.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_no_entries"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_no_entries", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHasEntry(t *testing.T) { - inputPath := "../../testlint/testCerts/IANDNSIA5String.pem" + inputPath := "IANDNSIA5String.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_no_entries"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_no_entries", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_rfc822_format_invalid_test.go b/lints/rfc/lint_ext_ian_rfc822_format_invalid_test.go index 90bf6a26a..f2a72cbf6 100644 --- a/lints/rfc/lint_ext_ian_rfc822_format_invalid_test.go +++ b/lints/rfc/lint_ext_ian_rfc822_format_invalid_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANInvalidEmail(t *testing.T) { - inputPath := "../../testlint/testCerts/IANInvalidEmail.pem" + inputPath := "IANInvalidEmail.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_rfc822_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_rfc822_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANValidEmail(t *testing.T) { - inputPath := "../../testlint/testCerts/IANValidEmail.pem" + inputPath := "IANValidEmail.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_rfc822_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_rfc822_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_space_dns_name_test.go b/lints/rfc/lint_ext_ian_space_dns_name_test.go index 978b0444c..834ef0bdd 100644 --- a/lints/rfc/lint_ext_ian_space_dns_name_test.go +++ b/lints/rfc/lint_ext_ian_space_dns_name_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANEmptyDNS(t *testing.T) { - inputPath := "../../testlint/testCerts/IANEmptyDNS.pem" + inputPath := "IANEmptyDNS.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_space_dns_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_space_dns_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANNotEmptyDNS(t *testing.T) { - inputPath := "../../testlint/testCerts/IANNonEmptyDNS.pem" + inputPath := "IANNonEmptyDNS.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_space_dns_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_space_dns_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_uri_format_invalid_test.go b/lints/rfc/lint_ext_ian_uri_format_invalid_test.go index a2e01e2de..9b29d64a0 100644 --- a/lints/rfc/lint_ext_ian_uri_format_invalid_test.go +++ b/lints/rfc/lint_ext_ian_uri_format_invalid_test.go @@ -20,31 +20,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANURIValid(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANURINoScheme(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURINoScheme.pem" + inputPath := "IANURINoScheme.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANURINoSchemeSpecificPart(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURINoSchemeSpecificPart.pem" + inputPath := "IANURINoSchemeSpecificPart.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_uri_host_not_fqdn_or_ip_test.go b/lints/rfc/lint_ext_ian_uri_host_not_fqdn_or_ip_test.go index 65c249d8d..dcdd60f98 100644 --- a/lints/rfc/lint_ext_ian_uri_host_not_fqdn_or_ip_test.go +++ b/lints/rfc/lint_ext_ian_uri_host_not_fqdn_or_ip_test.go @@ -18,58 +18,58 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANHostURINotFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostNotFQDNOrIP.pem" + inputPath := "IANURIHostNotFQDNOrIP.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHostURIFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostFQDN.pem" + inputPath := "IANURIHostFQDN.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHostURIIP(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostIP.pem" + inputPath := "IANURIHostIP.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHostWildcardFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostWildcardFQDN.pem" + inputPath := "IANURIHostWildcardFQDN.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHostWrongWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostWrongWildcard.pem" + inputPath := "IANURIHostWrongWildcard.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANHostAsterisk(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIHostAsterisk.pem" + inputPath := "IANURIHostAsterisk.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_uri_not_ia5_test.go b/lints/rfc/lint_ext_ian_uri_not_ia5_test.go index 7c2617037..c7c2f0d0a 100644 --- a/lints/rfc/lint_ext_ian_uri_not_ia5_test.go +++ b/lints/rfc/lint_ext_ian_uri_not_ia5_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANURIIA5(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIIA5String.pem" + inputPath := "IANURIIA5String.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_not_ia5"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_not_ia5", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANURINotIA5(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURINotIA5String.pem" + inputPath := "IANURINotIA5String.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_uri_not_ia5"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_not_ia5", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_ian_uri_relative_test.go b/lints/rfc/lint_ext_ian_uri_relative_test.go index 49820f671..91dc57dab 100644 --- a/lints/rfc/lint_ext_ian_uri_relative_test.go +++ b/lints/rfc/lint_ext_ian_uri_relative_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIANURIRelative(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURINoScheme.pem" + inputPath := "IANURINoScheme.pem" expected := lint.Error - out := lint.Lints["e_ext_ian_uri_relative"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_relative", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIANURIAbsolute(t *testing.T) { - inputPath := "../../testlint/testCerts/IANURIValid.pem" + inputPath := "IANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ext_ian_uri_relative"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_ian_uri_relative", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_key_usage_cert_sign_without_ca_test.go b/lints/rfc/lint_ext_key_usage_cert_sign_without_ca_test.go index c0f2d8f1f..a353484ea 100644 --- a/lints/rfc/lint_ext_key_usage_cert_sign_without_ca_test.go +++ b/lints/rfc/lint_ext_key_usage_cert_sign_without_ca_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCertSignNoCa(t *testing.T) { - inputPath := "../../testlint/testCerts/keyUsageCertSignNoBC.pem" + inputPath := "keyUsageCertSignNoBC.pem" expected := lint.Error - out := lint.Lints["e_ext_key_usage_cert_sign_without_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_cert_sign_without_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCertSignIsCa(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNoCertSign.pem" + inputPath := "caKeyUsageNoCertSign.pem" expected := lint.Pass - out := lint.Lints["e_ext_key_usage_cert_sign_without_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_cert_sign_without_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_key_usage_not_critical_test.go b/lints/rfc/lint_ext_key_usage_not_critical_test.go index 307e7b5b7..3a4433e42 100644 --- a/lints/rfc/lint_ext_key_usage_not_critical_test.go +++ b/lints/rfc/lint_ext_key_usage_not_critical_test.go @@ -18,49 +18,49 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertKeyUsageNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/keyUsageNotCriticalSubCert.pem" + inputPath := "keyUsageNotCriticalSubCert.pem" expected := lint.Warn - out := lint.Lints["w_ext_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaKeyUsageNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageNotCrit.pem" + inputPath := "caKeyUsageNotCrit.pem" expected := lint.Warn - out := lint.Lints["w_ext_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertKeyUsageCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/domainValGoodSubject.pem" + inputPath := "domainValGoodSubject.pem" expected := lint.Pass - out := lint.Lints["w_ext_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaKeyUsageCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["w_ext_key_usage_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_key_usage_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertKeyUsageNotIncludedCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageMissing.pem" + inputPath := "caKeyUsageMissing.pem" expected := lint.NA - out := lint.Lints["e_ext_key_usage_without_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_without_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_key_usage_without_bits_test.go b/lints/rfc/lint_ext_key_usage_without_bits_test.go index f893f7db2..4ed0a816a 100644 --- a/lints/rfc/lint_ext_key_usage_without_bits_test.go +++ b/lints/rfc/lint_ext_key_usage_without_bits_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertKeyUsageWithoutBits(t *testing.T) { - inputPath := "../../testlint/testCerts/keyUsageNoBits.pem" + inputPath := "keyUsageNoBits.pem" expected := lint.Error - out := lint.Lints["e_ext_key_usage_without_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_without_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertKeyUsageWithBits(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageCrit.pem" + inputPath := "caKeyUsageCrit.pem" expected := lint.Pass - out := lint.Lints["e_ext_key_usage_without_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_without_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertKeyUsageNotIncludedBits(t *testing.T) { - inputPath := "../../testlint/testCerts/caKeyUsageMissing.pem" + inputPath := "caKeyUsageMissing.pem" expected := lint.NA - out := lint.Lints["e_ext_key_usage_without_bits"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_key_usage_without_bits", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_name_constraints_not_critical_test.go b/lints/rfc/lint_ext_name_constraints_not_critical_test.go index c7a4df97e..f85c8235f 100644 --- a/lints/rfc/lint_ext_name_constraints_not_critical_test.go +++ b/lints/rfc/lint_ext_name_constraints_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNameConstraintsNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNameConstNoCrit.pem" + inputPath := "subCAWNameConstNoCrit.pem" expected := lint.Error - out := lint.Lints["e_ext_name_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_name_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNameConstraintsCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNameConstCrit.pem" + inputPath := "subCAWNameConstCrit.pem" expected := lint.Pass - out := lint.Lints["e_ext_name_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_name_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_name_constraints_not_in_ca_test.go b/lints/rfc/lint_ext_name_constraints_not_in_ca_test.go index e03619173..e00d6866a 100644 --- a/lints/rfc/lint_ext_name_constraints_not_in_ca_test.go +++ b/lints/rfc/lint_ext_name_constraints_not_in_ca_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNameConstraintsNotInCa(t *testing.T) { - inputPath := "../../testlint/testCerts/noNameConstraint.pem" + inputPath := "noNameConstraint.pem" expected := lint.Error - out := lint.Lints["e_ext_name_constraints_not_in_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_name_constraints_not_in_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNameConstraintsInCa(t *testing.T) { - inputPath := "../../testlint/testCerts/subCAWNameConstCrit.pem" + inputPath := "subCAWNameConstCrit.pem" expected := lint.Pass - out := lint.Lints["e_ext_name_constraints_not_in_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_name_constraints_not_in_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_policy_constraints_empty_test.go b/lints/rfc/lint_ext_policy_constraints_empty_test.go index 41cca41b7..0e4434bfd 100644 --- a/lints/rfc/lint_ext_policy_constraints_empty_test.go +++ b/lints/rfc/lint_ext_policy_constraints_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPolicyConstraintsEmpty(t *testing.T) { - inputPath := "../../testlint/testCerts/policyConstEmpty.pem" + inputPath := "policyConstEmpty.pem" expected := lint.Error - out := lint.Lints["e_ext_policy_constraints_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_constraints_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyConstraintsNotEmpty(t *testing.T) { - inputPath := "../../testlint/testCerts/policyConstGoodBoth.pem" + inputPath := "policyConstGoodBoth.pem" expected := lint.Pass - out := lint.Lints["e_ext_policy_constraints_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_constraints_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_policy_constraints_not_critical_test.go b/lints/rfc/lint_ext_policy_constraints_not_critical_test.go index 1560718ed..67016877b 100644 --- a/lints/rfc/lint_ext_policy_constraints_not_critical_test.go +++ b/lints/rfc/lint_ext_policy_constraints_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPolicyConstraintsNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/policyConstNotCritical.pem" + inputPath := "policyConstNotCritical.pem" expected := lint.Error - out := lint.Lints["e_ext_policy_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyConstraintsCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/policyConstGoodBoth.pem" + inputPath := "policyConstGoodBoth.pem" expected := lint.Pass - out := lint.Lints["e_ext_policy_constraints_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_constraints_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_policy_map_any_policy_test.go b/lints/rfc/lint_ext_policy_map_any_policy_test.go index 76934d6e2..4193a5885 100644 --- a/lints/rfc/lint_ext_policy_map_any_policy_test.go +++ b/lints/rfc/lint_ext_policy_map_any_policy_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPolicyMapFromAnyPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapFromAnyPolicy.pem" + inputPath := "policyMapFromAnyPolicy.pem" expected := lint.Error - out := lint.Lints["e_ext_policy_map_any_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_map_any_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyMapToAnyPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapToAnyPolicy.pem" + inputPath := "policyMapToAnyPolicy.pem" expected := lint.Error - out := lint.Lints["e_ext_policy_map_any_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_map_any_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyMapToNoAnyPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapGood.pem" + inputPath := "policyMapGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_policy_map_any_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_policy_map_any_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_policy_map_not_critical_test.go b/lints/rfc/lint_ext_policy_map_not_critical_test.go index 00f0c18cb..6416125a3 100644 --- a/lints/rfc/lint_ext_policy_map_not_critical_test.go +++ b/lints/rfc/lint_ext_policy_map_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPolicyMapNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapNotCritical.pem" + inputPath := "policyMapNotCritical.pem" expected := lint.Warn - out := lint.Lints["w_ext_policy_map_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_policy_map_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyMapCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapGood.pem" + inputPath := "policyMapGood.pem" expected := lint.Pass - out := lint.Lints["w_ext_policy_map_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_policy_map_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_policy_map_not_in_cert_policy_test.go b/lints/rfc/lint_ext_policy_map_not_in_cert_policy_test.go index 434bac17c..d2044e4c9 100644 --- a/lints/rfc/lint_ext_policy_map_not_in_cert_policy_test.go +++ b/lints/rfc/lint_ext_policy_map_not_in_cert_policy_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestPolicyMapInCertPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapIssuerNotInCertPolicy.pem" + inputPath := "policyMapIssuerNotInCertPolicy.pem" expected := lint.Warn - out := lint.Lints["w_ext_policy_map_not_in_cert_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_policy_map_not_in_cert_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestPolicyMapNotInCertPolicy(t *testing.T) { - inputPath := "../../testlint/testCerts/policyMapGood.pem" + inputPath := "policyMapGood.pem" expected := lint.Pass - out := lint.Lints["w_ext_policy_map_not_in_cert_policy"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_policy_map_not_in_cert_policy", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_dns_name_too_long_test.go b/lints/rfc/lint_ext_san_dns_name_too_long_test.go index 6f4d56025..91d682351 100644 --- a/lints/rfc/lint_ext_san_dns_name_too_long_test.go +++ b/lints/rfc/lint_ext_san_dns_name_too_long_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANDNSShort(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_dns_name_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_dns_name_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANDNSTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDNSTooLong.pem" + inputPath := "SANDNSTooLong.pem" expected := lint.Error - out := lint.Lints["e_ext_san_dns_name_too_long"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_dns_name_too_long", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_dns_not_ia5_string_test.go b/lints/rfc/lint_ext_san_dns_not_ia5_string_test.go index 76a065c7d..5dd5e1798 100644 --- a/lints/rfc/lint_ext_san_dns_not_ia5_string_test.go +++ b/lints/rfc/lint_ext_san_dns_not_ia5_string_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANDNSNotIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/SANDNSNotIA5String.pem" + inputPath := "SANDNSNotIA5String.pem" expected := lint.Error - out := lint.Lints["e_ext_san_dns_not_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_dns_not_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANDNSIA5String(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_dns_not_ia5_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_dns_not_ia5_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_empty_name_test.go b/lints/rfc/lint_ext_san_empty_name_test.go index 58181ec39..d54f8008f 100644 --- a/lints/rfc/lint_ext_san_empty_name_test.go +++ b/lints/rfc/lint_ext_san_empty_name_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANEmptyName(t *testing.T) { - inputPath := "../../testlint/testCerts/SANEmptyName.pem" + inputPath := "SANEmptyName.pem" expected := lint.Error - out := lint.Lints["e_ext_san_empty_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_empty_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANNotEmptyName(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCaGood.pem" + inputPath := "SANCaGood.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_empty_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_empty_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_no_entries_test.go b/lints/rfc/lint_ext_san_no_entries_test.go index 4398e29c0..c49796d9c 100644 --- a/lints/rfc/lint_ext_san_no_entries_test.go +++ b/lints/rfc/lint_ext_san_no_entries_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANNoEntry(t *testing.T) { - inputPath := "../../testlint/testCerts/SANNoEntries.pem" + inputPath := "SANNoEntries.pem" expected := lint.Error - out := lint.Lints["e_ext_san_no_entries"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_no_entries", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANHasEntry(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_no_entries"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_no_entries", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_not_critical_without_subject_test.go b/lints/rfc/lint_ext_san_not_critical_without_subject_test.go index 4c6c81214..810be062a 100644 --- a/lints/rfc/lint_ext_san_not_critical_without_subject_test.go +++ b/lints/rfc/lint_ext_san_not_critical_without_subject_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectEmptySANNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/SANSubjectEmptyNotCritical.pem" + inputPath := "SANSubjectEmptyNotCritical.pem" expected := lint.Error - out := lint.Lints["e_ext_san_not_critical_without_subject"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_not_critical_without_subject", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectEmptySANCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subCaEmptySubject.pem" + inputPath := "subCaEmptySubject.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_not_critical_without_subject"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_not_critical_without_subject", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectNotEmptySANCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/SANCriticalSubjectUncommonOnly.pem" + inputPath := "SANCriticalSubjectUncommonOnly.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_not_critical_without_subject"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_not_critical_without_subject", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_rfc822_format_invalid_test.go b/lints/rfc/lint_ext_san_rfc822_format_invalid_test.go index 2e3951c16..0c378c660 100644 --- a/lints/rfc/lint_ext_san_rfc822_format_invalid_test.go +++ b/lints/rfc/lint_ext_san_rfc822_format_invalid_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANInvalidEmail(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWithInvalidEmail.pem" + inputPath := "SANWithInvalidEmail.pem" expected := lint.Error - out := lint.Lints["e_ext_san_rfc822_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANInvalidEmail2(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWithInvalidEmail2.pem" + inputPath := "SANWithInvalidEmail2.pem" expected := lint.Error - out := lint.Lints["e_ext_san_rfc822_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANValidEmail(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWithValidEmail.pem" + inputPath := "SANWithValidEmail.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_rfc822_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_rfc822_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_space_dns_name_test.go b/lints/rfc/lint_ext_san_space_dns_name_test.go index e6da3388f..709521ce3 100644 --- a/lints/rfc/lint_ext_san_space_dns_name_test.go +++ b/lints/rfc/lint_ext_san_space_dns_name_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANGood(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_space_dns_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_space_dns_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANSpace(t *testing.T) { - inputPath := "../../testlint/testCerts/SANWithSpaceDNS.pem" + inputPath := "SANWithSpaceDNS.pem" expected := lint.Error - out := lint.Lints["e_ext_san_space_dns_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_space_dns_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_uri_format_invalid_test.go b/lints/rfc/lint_ext_san_uri_format_invalid_test.go index 5a2101a08..888ed3b34 100644 --- a/lints/rfc/lint_ext_san_uri_format_invalid_test.go +++ b/lints/rfc/lint_ext_san_uri_format_invalid_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANURIValid(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIValid.pem" + inputPath := "SANURIValid.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURINoScheme(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURINoScheme.pem" + inputPath := "SANURINoScheme.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURINoSchemeSpecificPart(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURINoSchemeSpecificPart.pem" + inputPath := "SANURINoSchemeSpecificPart.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_format_invalid"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_format_invalid", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_uri_host_not_fqdn_or_ip_test.go b/lints/rfc/lint_ext_san_uri_host_not_fqdn_or_ip_test.go index 9d7808280..077247051 100644 --- a/lints/rfc/lint_ext_san_uri_host_not_fqdn_or_ip_test.go +++ b/lints/rfc/lint_ext_san_uri_host_not_fqdn_or_ip_test.go @@ -18,49 +18,49 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANURIHostNotFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURINotFQDN.pem" + inputPath := "SANURINotFQDN.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIHostWildcardFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIHostWildcardFQDN.pem" + inputPath := "SANURIHostWildcardFQDN.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIHostWrongWildcard(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIHostWrongWildcard.pem" + inputPath := "SANURIHostWrongWildcard.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIHostAsterisk(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIHostAsterisk.pem" + inputPath := "SANURIHostAsterisk.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIHostFQDN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIHostFQDN.pem" + inputPath := "SANURIHostFQDN.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } @@ -69,9 +69,9 @@ func TestSANURIHostFQDN(t *testing.T) { func TestSANURINoAuthority(t *testing.T) { // This certificate has a SAN with URI=sip:alice@sip.uri.com // Since this has no authority section, it should be accepted. - inputPath := "../../testlint/testCerts/SANURINoAuthority.pem" + inputPath := "SANURINoAuthority.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_host_not_fqdn_or_ip"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_host_not_fqdn_or_ip", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_uri_not_ia5_test.go b/lints/rfc/lint_ext_san_uri_not_ia5_test.go index a885b9a36..28930b292 100644 --- a/lints/rfc/lint_ext_san_uri_not_ia5_test.go +++ b/lints/rfc/lint_ext_san_uri_not_ia5_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANURIIA5(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIIA5.pem" + inputPath := "SANURIIA5.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_not_ia5"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_not_ia5", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURINotIA5(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURINotIA5.pem" + inputPath := "SANURINotIA5.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_not_ia5"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_not_ia5", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_san_uri_relative_test.go b/lints/rfc/lint_ext_san_uri_relative_test.go index 25cdc08c3..7fdea9b65 100644 --- a/lints/rfc/lint_ext_san_uri_relative_test.go +++ b/lints/rfc/lint_ext_san_uri_relative_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSANURIRelative(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIRelative.pem" + inputPath := "SANURIRelative.pem" expected := lint.Error - out := lint.Lints["e_ext_san_uri_relative"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_relative", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSANURIAbsolute(t *testing.T) { - inputPath := "../../testlint/testCerts/SANURIAbsolute.pem" + inputPath := "SANURIAbsolute.pem" expected := lint.Pass - out := lint.Lints["e_ext_san_uri_relative"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_san_uri_relative", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_subject_directory_attr_critical_test.go b/lints/rfc/lint_ext_subject_directory_attr_critical_test.go index ef2f8c375..5e8b8523c 100644 --- a/lints/rfc/lint_ext_subject_directory_attr_critical_test.go +++ b/lints/rfc/lint_ext_subject_directory_attr_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSdaCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/subDirAttCritical.pem" + inputPath := "subDirAttCritical.pem" expected := lint.Error - out := lint.Lints["e_ext_subject_directory_attr_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_directory_attr_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSdaNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/RFC5280example2.pem" + inputPath := "RFC5280example2.pem" expected := lint.Pass - out := lint.Lints["e_ext_subject_directory_attr_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_directory_attr_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_subject_key_identifier_critical_test.go b/lints/rfc/lint_ext_subject_key_identifier_critical_test.go index 9da0a3060..a5a8ebd8d 100644 --- a/lints/rfc/lint_ext_subject_key_identifier_critical_test.go +++ b/lints/rfc/lint_ext_subject_key_identifier_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSkiCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/skiCriticalCA.pem" + inputPath := "skiCriticalCA.pem" expected := lint.Error - out := lint.Lints["e_ext_subject_key_identifier_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_key_identifier_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSkiNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/skiNotCriticalCA.pem" + inputPath := "skiNotCriticalCA.pem" expected := lint.Pass - out := lint.Lints["e_ext_subject_key_identifier_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_key_identifier_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_subject_key_identifier_missing_ca_test.go b/lints/rfc/lint_ext_subject_key_identifier_missing_ca_test.go index 91001dd5d..a20952b6e 100644 --- a/lints/rfc/lint_ext_subject_key_identifier_missing_ca_test.go +++ b/lints/rfc/lint_ext_subject_key_identifier_missing_ca_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCaSkiMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCANoSKI.pem" + inputPath := "subCANoSKI.pem" expected := lint.Error - out := lint.Lints["e_ext_subject_key_identifier_missing_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_key_identifier_missing_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCaSkiPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/skiNotCriticalCA.pem" + inputPath := "skiNotCriticalCA.pem" expected := lint.Pass - out := lint.Lints["e_ext_subject_key_identifier_missing_ca"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_ext_subject_key_identifier_missing_ca", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_ext_subject_key_identifier_missing_sub_cert_test.go b/lints/rfc/lint_ext_subject_key_identifier_missing_sub_cert_test.go index 7731c69e2..4696aff01 100644 --- a/lints/rfc/lint_ext_subject_key_identifier_missing_sub_cert_test.go +++ b/lints/rfc/lint_ext_subject_key_identifier_missing_sub_cert_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubCertSkiMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertNoSKI.pem" + inputPath := "subCertNoSKI.pem" expected := lint.Warn - out := lint.Lints["w_ext_subject_key_identifier_missing_sub_cert"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_subject_key_identifier_missing_sub_cert", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertSkiPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["w_ext_subject_key_identifier_missing_sub_cert"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_ext_subject_key_identifier_missing_sub_cert", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_generalized_time_not_in_zulu_test.go b/lints/rfc/lint_generalized_time_not_in_zulu_test.go index a437986f8..c297abd04 100644 --- a/lints/rfc/lint_generalized_time_not_in_zulu_test.go +++ b/lints/rfc/lint_generalized_time_not_in_zulu_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestGenralizedNotZulu(t *testing.T) { - inputPath := "../../testlint/testCerts/generalizedNotZulu.pem" + inputPath := "generalizedNotZulu.pem" expected := lint.Error - out := lint.Lints["e_generalized_time_not_in_zulu"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_generalized_time_not_in_zulu", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestGenralizedZulu(t *testing.T) { - inputPath := "../../testlint/testCerts/generalizedHasSeconds.pem" + inputPath := "generalizedHasSeconds.pem" expected := lint.Pass - out := lint.Lints["e_generalized_time_not_in_zulu"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_generalized_time_not_in_zulu", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_idn_dnsname_malformed_unicode_test.go b/lints/rfc/lint_idn_dnsname_malformed_unicode_test.go index 33908c47d..793a14511 100644 --- a/lints/rfc/lint_idn_dnsname_malformed_unicode_test.go +++ b/lints/rfc/lint_idn_dnsname_malformed_unicode_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIDNMalformedUnicode(t *testing.T) { - inputPath := "../../testlint/testCerts/idnMalformedUnicode.pem" + inputPath := "idnMalformedUnicode.pem" expected := lint.Error - out := lint.Lints["e_international_dns_name_not_unicode"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_international_dns_name_not_unicode", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIDNCorrectUnicode(t *testing.T) { - inputPath := "../../testlint/testCerts/idnCorrectUnicode.pem" + inputPath := "idnCorrectUnicode.pem" expected := lint.Pass - out := lint.Lints["e_international_dns_name_not_unicode"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_international_dns_name_not_unicode", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_idn_dnsname_must_be_nfc_test.go b/lints/rfc/lint_idn_dnsname_must_be_nfc_test.go index 597133f1f..2ddafb5c2 100644 --- a/lints/rfc/lint_idn_dnsname_must_be_nfc_test.go +++ b/lints/rfc/lint_idn_dnsname_must_be_nfc_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIDNDnsNameNotNFC(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNamesNotNFC.pem" + inputPath := "dnsNamesNotNFC.pem" expected := lint.Error - out := lint.Lints["e_international_dns_name_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_international_dns_name_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIDNDnsNameIsNFC(t *testing.T) { - inputPath := "../../testlint/testCerts/dnsNamesNFC.pem" + inputPath := "dnsNamesNFC.pem" expected := lint.Pass - out := lint.Lints["e_international_dns_name_not_nfc"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_international_dns_name_not_nfc", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_inhibit_any_policy_not_critical_test.go b/lints/rfc/lint_inhibit_any_policy_not_critical_test.go index 3c5abc2b5..3ea14ee91 100644 --- a/lints/rfc/lint_inhibit_any_policy_not_critical_test.go +++ b/lints/rfc/lint_inhibit_any_policy_not_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestInhibitAnyPolicyNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/inhibitAnyNotCrit.pem" + inputPath := "inhibitAnyNotCrit.pem" expected := lint.Error - out := lint.Lints["e_inhibit_any_policy_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_inhibit_any_policy_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestInhibitAnyPolicyCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/inhibitAnyCrit.pem" + inputPath := "inhibitAnyCrit.pem" expected := lint.Pass - out := lint.Lints["e_inhibit_any_policy_not_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_inhibit_any_policy_not_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_issuer_dn_country_not_printable_string_test.go b/lints/rfc/lint_issuer_dn_country_not_printable_string_test.go index 625c19320..c7ccb1cd5 100644 --- a/lints/rfc/lint_issuer_dn_country_not_printable_string_test.go +++ b/lints/rfc/lint_issuer_dn_country_not_printable_string_test.go @@ -18,24 +18,24 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestIssuerCountryGood(t *testing.T) { - inputPath := "../../testlint/testCerts/SubjectDNAndIssuerDNCountryPrintableString.pem" + inputPath := "SubjectDNAndIssuerDNCountryPrintableString.pem" expected := lint.Pass - out := lint.Lints["e_issuer_dn_country_not_printable_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_issuer_dn_country_not_printable_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestIssuerCountryBad(t *testing.T) { - inputPath := "../../testlint/testCerts/IssuerDNCountryNotPrintableString.pem" + inputPath := "IssuerDNCountryNotPrintableString.pem" expected := lint.Error - out := lint.Lints["e_issuer_dn_country_not_printable_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_issuer_dn_country_not_printable_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_issuer_field_empty_test.go b/lints/rfc/lint_issuer_field_empty_test.go index ef528187f..bf87eebd8 100644 --- a/lints/rfc/lint_issuer_field_empty_test.go +++ b/lints/rfc/lint_issuer_field_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNoIssuerField(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerFieldMissing.pem" + inputPath := "issuerFieldMissing.pem" expected := lint.Error - out := lint.Lints["e_issuer_field_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_issuer_field_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestHasIssuerField(t *testing.T) { - inputPath := "../../testlint/testCerts/issuerFieldFilled.pem" + inputPath := "issuerFieldFilled.pem" expected := lint.Pass - out := lint.Lints["e_issuer_field_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_issuer_field_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_empty_test.go b/lints/rfc/lint_name_constraint_empty_test.go index 7034dbba6..338d1816f 100644 --- a/lints/rfc/lint_name_constraint_empty_test.go +++ b/lints/rfc/lint_name_constraint_empty_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNoNameConstraint(t *testing.T) { - inputPath := "../../testlint/testCerts/noNameConstraint.pem" + inputPath := "noNameConstraint.pem" expected := lint.Error - out := lint.Lints["e_name_constraint_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestHasNameConstraint(t *testing.T) { - inputPath := "../../testlint/testCerts/yesNameConstraint.pem" + inputPath := "yesNameConstraint.pem" expected := lint.Pass - out := lint.Lints["e_name_constraint_empty"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_empty", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_maximum_not_absent_test.go b/lints/rfc/lint_name_constraint_maximum_not_absent_test.go index 8c5140b12..17e7fbbaf 100644 --- a/lints/rfc/lint_name_constraint_maximum_not_absent_test.go +++ b/lints/rfc/lint_name_constraint_maximum_not_absent_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNcMaxPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/ncAllPres.pem" + inputPath := "ncAllPres.pem" expected := lint.Error - out := lint.Lints["e_name_constraint_maximum_not_absent"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_maximum_not_absent", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcMinPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinPres.pem" + inputPath := "ncMinPres.pem" expected := lint.Pass - out := lint.Lints["e_name_constraint_maximum_not_absent"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_maximum_not_absent", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcEmptyValue(t *testing.T) { - inputPath := "../../testlint/testCerts/ncEmptyValue.pem" + inputPath := "ncEmptyValue.pem" expected := lint.Pass - out := lint.Lints["e_name_constraint_maximum_not_absent"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_maximum_not_absent", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_minimum_non_zero_test.go b/lints/rfc/lint_name_constraint_minimum_non_zero_test.go index 09e881960..b48b36075 100644 --- a/lints/rfc/lint_name_constraint_minimum_non_zero_test.go +++ b/lints/rfc/lint_name_constraint_minimum_non_zero_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNcMinZero(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinZero.pem" + inputPath := "ncMinZero.pem" expected := lint.Pass - out := lint.Lints["e_name_constraint_minimum_non_zero"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_minimum_non_zero", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcMinNotZero(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinPres.pem" + inputPath := "ncMinPres.pem" expected := lint.Error - out := lint.Lints["e_name_constraint_minimum_non_zero"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_name_constraint_minimum_non_zero", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_on_edi_party_name_test.go b/lints/rfc/lint_name_constraint_on_edi_party_name_test.go index bd587dea4..4531da931 100644 --- a/lints/rfc/lint_name_constraint_on_edi_party_name_test.go +++ b/lints/rfc/lint_name_constraint_on_edi_party_name_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNcNoEDI(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinZero.pem" + inputPath := "ncMinZero.pem" expected := lint.Pass - out := lint.Lints["w_name_constraint_on_edi_party_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_edi_party_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcEDI(t *testing.T) { - inputPath := "../../testlint/testCerts/ncOnEDI.pem" + inputPath := "ncOnEDI.pem" expected := lint.Warn - out := lint.Lints["w_name_constraint_on_edi_party_name"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_edi_party_name", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_on_registered_id_test.go b/lints/rfc/lint_name_constraint_on_registered_id_test.go index b0a60ee5b..dcab07b3e 100644 --- a/lints/rfc/lint_name_constraint_on_registered_id_test.go +++ b/lints/rfc/lint_name_constraint_on_registered_id_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNcNoRegId(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinZero.pem" + inputPath := "ncMinZero.pem" expected := lint.Pass - out := lint.Lints["w_name_constraint_on_registered_id"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_registered_id", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcRegId(t *testing.T) { - inputPath := "../../testlint/testCerts/ncOnRegId.pem" + inputPath := "ncOnRegId.pem" expected := lint.Warn - out := lint.Lints["w_name_constraint_on_registered_id"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_registered_id", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_name_constraint_on_x400_test.go b/lints/rfc/lint_name_constraint_on_x400_test.go index 5d7e0dd47..7255c1269 100644 --- a/lints/rfc/lint_name_constraint_on_x400_test.go +++ b/lints/rfc/lint_name_constraint_on_x400_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestNcNoX400(t *testing.T) { - inputPath := "../../testlint/testCerts/ncMinZero.pem" + inputPath := "ncMinZero.pem" expected := lint.Pass - out := lint.Lints["w_name_constraint_on_x400"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_x400", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestNcX400(t *testing.T) { - inputPath := "../../testlint/testCerts/ncOnX400.pem" + inputPath := "ncOnX400.pem" expected := lint.Warn - out := lint.Lints["w_name_constraint_on_x400"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("w_name_constraint_on_x400", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_path_len_constraint_improperly_included_test.go b/lints/rfc/lint_path_len_constraint_improperly_included_test.go index 4fce289b8..93e16f181 100644 --- a/lints/rfc/lint_path_len_constraint_improperly_included_test.go +++ b/lints/rfc/lint_path_len_constraint_improperly_included_test.go @@ -18,49 +18,49 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaMaxLenPresentNoCertSign(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathLenPresentNoCertSign.pem" + inputPath := "caMaxPathLenPresentNoCertSign.pem" expected := lint.Error - out := lint.Lints["e_path_len_constraint_improperly_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_improperly_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaMaxLenPresentGood(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathLenPositive.pem" + inputPath := "caMaxPathLenPositive.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_improperly_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_improperly_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaMaxLenMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathLenMissing.pem" + inputPath := "caMaxPathLenMissing.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_improperly_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_improperly_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertMaxLenPresent(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPathLenPositive.pem" + inputPath := "subCertPathLenPositive.pem" expected := lint.Error - out := lint.Lints["e_path_len_constraint_improperly_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_improperly_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertMaxLenNone(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_improperly_included"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_improperly_included", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_path_len_constraint_zero_or_less_test.go b/lints/rfc/lint_path_len_constraint_zero_or_less_test.go index 8279a85a3..fa3a4b61d 100644 --- a/lints/rfc/lint_path_len_constraint_zero_or_less_test.go +++ b/lints/rfc/lint_path_len_constraint_zero_or_less_test.go @@ -18,58 +18,58 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestCaMaxLenNegative(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathNegative.pem" + inputPath := "caMaxPathNegative.pem" expected := lint.Error - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCerMaxLenNegative(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPathLenNegative.pem" + inputPath := "subCertPathLenNegative.pem" expected := lint.Error - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCaMaxLenPositive(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathLenPositive.pem" + inputPath := "caMaxPathLenPositive.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertMaxLenPositive(t *testing.T) { - inputPath := "../../testlint/testCerts/subCertPathLenPositive.pem" + inputPath := "subCertPathLenPositive.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubCertMaxLenMissing(t *testing.T) { - inputPath := "../../testlint/testCerts/caBasicConstMissing.pem" + inputPath := "caBasicConstMissing.pem" expected := lint.NA - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestCAMaxLenNone(t *testing.T) { - inputPath := "../../testlint/testCerts/caMaxPathLenMissing.pem" + inputPath := "caMaxPathLenMissing.pem" expected := lint.Pass - out := lint.Lints["e_path_len_constraint_zero_or_less"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_path_len_constraint_zero_or_less", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_serial_number_longer_than_20_octets_test.go b/lints/rfc/lint_serial_number_longer_than_20_octets_test.go index 4daab9fb9..375edb36c 100644 --- a/lints/rfc/lint_serial_number_longer_than_20_octets_test.go +++ b/lints/rfc/lint_serial_number_longer_than_20_octets_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSnTooLarge(t *testing.T) { - inputPath := "../../testlint/testCerts/serialNumberLarge.pem" + inputPath := "serialNumberLarge.pem" expected := lint.Error - out := lint.Lints["e_serial_number_longer_than_20_octets"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_serial_number_longer_than_20_octets", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSnNotTooLarge(t *testing.T) { - inputPath := "../../testlint/testCerts/serialNumberValid.pem" + inputPath := "serialNumberValid.pem" expected := lint.Pass - out := lint.Lints["e_serial_number_longer_than_20_octets"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_serial_number_longer_than_20_octets", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_serial_number_not_positive_test.go b/lints/rfc/lint_serial_number_not_positive_test.go index 0c40d5690..b4fa36e79 100644 --- a/lints/rfc/lint_serial_number_not_positive_test.go +++ b/lints/rfc/lint_serial_number_not_positive_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSnNeagtive(t *testing.T) { - inputPath := "../../testlint/testCerts/serialNumberNegative.pem" + inputPath := "serialNumberNegative.pem" expected := lint.Error - out := lint.Lints["e_serial_number_not_positive"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_serial_number_not_positive", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSnNotNeagtive(t *testing.T) { - inputPath := "../../testlint/testCerts/serialNumberValid.pem" + inputPath := "serialNumberValid.pem" expected := lint.Pass - out := lint.Lints["e_serial_number_not_positive"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_serial_number_not_positive", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_spki_rsa_encryption_parameter_not_null_test.go b/lints/rfc/lint_spki_rsa_encryption_parameter_not_null_test.go index 94ce31b88..1ab24062b 100644 --- a/lints/rfc/lint_spki_rsa_encryption_parameter_not_null_test.go +++ b/lints/rfc/lint_spki_rsa_encryption_parameter_not_null_test.go @@ -1,11 +1,10 @@ package rfc import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestRSAAlgIDNullParams(t *testing.T) { @@ -37,8 +36,7 @@ func TestRSAAlgIDNullParams(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.filepath) - result := lint.Lints["e_spki_rsa_encryption_parameter_not_null"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_spki_rsa_encryption_parameter_not_null", tc.filepath) if result.Status != tc.expectedStatus { t.Errorf("expected result %v was %v", tc.expectedStatus, result.Status) } diff --git a/lints/rfc/lint_subject_common_name_max_length_test.go b/lints/rfc/lint_subject_common_name_max_length_test.go index 9aa2a2da3..8b91e67e8 100644 --- a/lints/rfc/lint_subject_common_name_max_length_test.go +++ b/lints/rfc/lint_subject_common_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectCommonNameLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectCommonNameLengthGood.pem" + inputPath := "subjectCommonNameLengthGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_common_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_common_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectCommonNameLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectCommonNameLong.pem" + inputPath := "subjectCommonNameLong.pem" expected := lint.Error - out := lint.Lints["e_subject_common_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_common_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_dn_country_not_printable_string_test.go b/lints/rfc/lint_subject_dn_country_not_printable_string_test.go index 0fdcf6589..e099652bf 100644 --- a/lints/rfc/lint_subject_dn_country_not_printable_string_test.go +++ b/lints/rfc/lint_subject_dn_country_not_printable_string_test.go @@ -18,24 +18,24 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectCountryGood(t *testing.T) { - inputPath := "../../testlint/testCerts/SubjectDNAndIssuerDNCountryPrintableString.pem" + inputPath := "SubjectDNAndIssuerDNCountryPrintableString.pem" expected := lint.Pass - out := lint.Lints["e_subject_dn_country_not_printable_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_country_not_printable_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectCountryBad(t *testing.T) { - inputPath := "../../testlint/testCerts/SubjectDNCountryNotPrintableString.pem" + inputPath := "SubjectDNCountryNotPrintableString.pem" expected := lint.Error - out := lint.Lints["e_subject_dn_country_not_printable_string"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_country_not_printable_string", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_dn_not_printable_characters_test.go b/lints/rfc/lint_subject_dn_not_printable_characters_test.go index 96346206f..b2a6b5ff8 100644 --- a/lints/rfc/lint_subject_dn_not_printable_characters_test.go +++ b/lints/rfc/lint_subject_dn_not_printable_characters_test.go @@ -18,34 +18,34 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectCharactersGood(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_subject_dn_not_printable_characters"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_not_printable_characters", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectCharactersGoodUTF8(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectDNNotPrintableCharsUTF8.pem" + inputPath := "subjectDNNotPrintableCharsUTF8.pem" expected := lint.Pass - out := lint.Lints["e_subject_dn_not_printable_characters"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_not_printable_characters", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectCharactersBad(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectDNNotPrintableCharacters.pem" + inputPath := "subjectDNNotPrintableCharacters.pem" expected := lint.Error - out := lint.Lints["e_subject_dn_not_printable_characters"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_not_printable_characters", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_dn_serial_number_max_length_test.go b/lints/rfc/lint_subject_dn_serial_number_max_length_test.go index de70f1918..2c64681af 100644 --- a/lints/rfc/lint_subject_dn_serial_number_max_length_test.go +++ b/lints/rfc/lint_subject_dn_serial_number_max_length_test.go @@ -18,24 +18,24 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectDNSerialNumberBelowMaximumLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/evAllGood.pem" + inputPath := "evAllGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_dn_serial_number_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_serial_number_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectDNSerialNumberTooLongBad(t *testing.T) { - inputPath := "../../testlint/testCerts/SubjectDNSerialNumberTooLong.pem" + inputPath := "SubjectDNSerialNumberTooLong.pem" expected := lint.Error - out := lint.Lints["e_subject_dn_serial_number_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_dn_serial_number_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_email_max_length_test.go b/lints/rfc/lint_subject_email_max_length_test.go index 370c92d99..f638d0064 100644 --- a/lints/rfc/lint_subject_email_max_length_test.go +++ b/lints/rfc/lint_subject_email_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectEmailLengthOK(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectEmailPresent.pem" + inputPath := "subjectEmailPresent.pem" expected := lint.Pass - out := lint.Lints["e_subject_email_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_email_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectEmailTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/SubjectEmailToolLong.pem" + inputPath := "SubjectEmailToolLong.pem" expected := lint.Error - out := lint.Lints["e_subject_email_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_email_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_empty_without_san_test.go b/lints/rfc/lint_subject_empty_without_san_test.go index 2624c2a26..19ba1c2a0 100644 --- a/lints/rfc/lint_subject_empty_without_san_test.go +++ b/lints/rfc/lint_subject_empty_without_san_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubEmptyNoSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectEmptyNoSAN.pem" + inputPath := "subjectEmptyNoSAN.pem" expected := lint.Error - out := lint.Lints["e_subject_empty_without_san"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_empty_without_san", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubEmptyYesSAN(t *testing.T) { - inputPath := "../../testlint/testCerts/SANSubjectEmptyNotCritical.pem" + inputPath := "SANSubjectEmptyNotCritical.pem" expected := lint.Pass - out := lint.Lints["e_subject_empty_without_san"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_empty_without_san", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_given_name_max_length_test.go b/lints/rfc/lint_subject_given_name_max_length_test.go index f8fe94ecf..c424601e4 100644 --- a/lints/rfc/lint_subject_given_name_max_length_test.go +++ b/lints/rfc/lint_subject_given_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectGivenNameLengthOK(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectGivenName.pem" + inputPath := "subjectGivenName.pem" expected := lint.Pass - out := lint.Lints["e_subject_given_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_given_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectGivenNameTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectGivenNameToolLong.pem" + inputPath := "subjectGivenNameToolLong.pem" expected := lint.Error - out := lint.Lints["e_subject_given_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_given_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_info_access_marked_critical_test.go b/lints/rfc/lint_subject_info_access_marked_critical_test.go index a34c9c26b..4de196fae 100644 --- a/lints/rfc/lint_subject_info_access_marked_critical_test.go +++ b/lints/rfc/lint_subject_info_access_marked_critical_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSiaCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/siaCrit.pem" + inputPath := "siaCrit.pem" expected := lint.Error - out := lint.Lints["e_subject_info_access_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_info_access_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSiaNotCrit(t *testing.T) { - inputPath := "../../testlint/testCerts/siaNotCrit.pem" + inputPath := "siaNotCrit.pem" expected := lint.Pass - out := lint.Lints["e_subject_info_access_marked_critical"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_info_access_marked_critical", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_locality_name_max_length_test.go b/lints/rfc/lint_subject_locality_name_max_length_test.go index 43124ee10..76dda3059 100644 --- a/lints/rfc/lint_subject_locality_name_max_length_test.go +++ b/lints/rfc/lint_subject_locality_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectLocalityNameLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectLocalityNameLengthGood.pem" + inputPath := "subjectLocalityNameLengthGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_locality_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_locality_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectLocalityNameLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectLocalityNameLong.pem" + inputPath := "subjectLocalityNameLong.pem" expected := lint.Error - out := lint.Lints["e_subject_locality_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_locality_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_organization_name_max_length_test.go b/lints/rfc/lint_subject_organization_name_max_length_test.go index b9a344ff4..bb130f8af 100644 --- a/lints/rfc/lint_subject_organization_name_max_length_test.go +++ b/lints/rfc/lint_subject_organization_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectOrganizationNameLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectOrganizationNameLengthGood.pem" + inputPath := "subjectOrganizationNameLengthGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_organization_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_organization_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectOrganzationNameLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectOrganizationNameLong.pem" + inputPath := "subjectOrganizationNameLong.pem" expected := lint.Error - out := lint.Lints["e_subject_organization_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_organization_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_organizational_unit_name_max_length_test.go b/lints/rfc/lint_subject_organizational_unit_name_max_length_test.go index ffb974ded..a3b74e7d2 100644 --- a/lints/rfc/lint_subject_organizational_unit_name_max_length_test.go +++ b/lints/rfc/lint_subject_organizational_unit_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectOrganizationalUnitNameLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectOrganizationalUnitNameLengthGood.pem" + inputPath := "subjectOrganizationalUnitNameLengthGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_organizational_unit_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_organizational_unit_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectOrganzationalUnitNameLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectOrganizationalUnitNameLong.pem" + inputPath := "subjectOrganizationalUnitNameLong.pem" expected := lint.Error - out := lint.Lints["e_subject_organizational_unit_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_organizational_unit_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_postal_code_max_length_test.go b/lints/rfc/lint_subject_postal_code_max_length_test.go index 35f33129d..f7a1bd49a 100644 --- a/lints/rfc/lint_subject_postal_code_max_length_test.go +++ b/lints/rfc/lint_subject_postal_code_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectPostalCodeLengthOK(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectPostalCode.pem" + inputPath := "subjectPostalCode.pem" expected := lint.Pass - out := lint.Lints["e_subject_postal_code_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_postal_code_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectPostalCodeTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectPostalCodeTooLong.pem" + inputPath := "subjectPostalCodeTooLong.pem" expected := lint.Error - out := lint.Lints["e_subject_postal_code_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_postal_code_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_printable_string_badalpha_test.go b/lints/rfc/lint_subject_printable_string_badalpha_test.go index 89340afd2..944a19e30 100644 --- a/lints/rfc/lint_subject_printable_string_badalpha_test.go +++ b/lints/rfc/lint_subject_printable_string_badalpha_test.go @@ -1,11 +1,10 @@ package rfc import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectPrintableStringBadAlpha(t *testing.T) { @@ -46,8 +45,7 @@ func TestSubjectPrintableStringBadAlpha(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.filename) - result := lint.Lints["e_subject_printable_string_badalpha"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_subject_printable_string_badalpha", tc.filename) if result.Status != tc.expected.Status { t.Errorf("expected result status %v was %v", tc.expected.Status, result.Status) } diff --git a/lints/rfc/lint_subject_state_name_max_length_test.go b/lints/rfc/lint_subject_state_name_max_length_test.go index 3baaa2450..351e297e8 100644 --- a/lints/rfc/lint_subject_state_name_max_length_test.go +++ b/lints/rfc/lint_subject_state_name_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectStateNameLengthGood(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectStateNameLengthGood.pem" + inputPath := "subjectStateNameLengthGood.pem" expected := lint.Pass - out := lint.Lints["e_subject_state_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_state_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectStateNameLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectStateNameLong.pem" + inputPath := "subjectStateNameLong.pem" expected := lint.Error - out := lint.Lints["e_subject_state_name_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_state_name_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_street_address_max_length_test.go b/lints/rfc/lint_subject_street_address_max_length_test.go index c502ae678..fb34bf084 100644 --- a/lints/rfc/lint_subject_street_address_max_length_test.go +++ b/lints/rfc/lint_subject_street_address_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectStreetAddressLengthOK(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectStreetAddress.pem" + inputPath := "subjectStreetAddress.pem" expected := lint.Pass - out := lint.Lints["e_subject_street_address_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_street_address_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectStreetAddressTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectStreetAddressTooLong.pem" + inputPath := "subjectStreetAddressTooLong.pem" expected := lint.Error - out := lint.Lints["e_subject_street_address_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_street_address_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_subject_surname_max_length_test.go b/lints/rfc/lint_subject_surname_max_length_test.go index 8ea6992ed..0cd1a5ed2 100644 --- a/lints/rfc/lint_subject_surname_max_length_test.go +++ b/lints/rfc/lint_subject_surname_max_length_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSubjectSurnameLengthOK(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectSurname.pem" + inputPath := "subjectSurname.pem" expected := lint.Pass - out := lint.Lints["e_subject_surname_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_surname_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestSubjectSurnameTooLong(t *testing.T) { - inputPath := "../../testlint/testCerts/subjectSurnameTooLong.pem" + inputPath := "subjectSurnameTooLong.pem" expected := lint.Error - out := lint.Lints["e_subject_surname_max_length"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_subject_surname_max_length", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_tbs_signature_rsa_encryption_parameter_not_null_test.go b/lints/rfc/lint_tbs_signature_rsa_encryption_parameter_not_null_test.go index be05795a2..6eb702324 100644 --- a/lints/rfc/lint_tbs_signature_rsa_encryption_parameter_not_null_test.go +++ b/lints/rfc/lint_tbs_signature_rsa_encryption_parameter_not_null_test.go @@ -1,11 +1,10 @@ package rfc import ( - "fmt" "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestSigRSAAlgIDNullParams(t *testing.T) { @@ -31,8 +30,7 @@ func TestSigRSAAlgIDNullParams(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - inputPath := fmt.Sprintf("%s%s", util.TestCaseDir, tc.filepath) - result := lint.Lints["e_tbs_signature_rsa_encryption_parameter_not_null"].Execute(util.ReadCertificate(inputPath)) + result := test.TestLint("e_tbs_signature_rsa_encryption_parameter_not_null", tc.filepath) if result.Status != tc.expectedStatus { t.Errorf("expected result %v was %v", tc.expectedStatus, result.Status) } diff --git a/lints/rfc/lint_utc_time_does_not_include_seconds_test.go b/lints/rfc/lint_utc_time_does_not_include_seconds_test.go index 8efd6d6f5..c2333f63e 100644 --- a/lints/rfc/lint_utc_time_does_not_include_seconds_test.go +++ b/lints/rfc/lint_utc_time_does_not_include_seconds_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestUtcHasSeconds(t *testing.T) { - inputPath := "../../testlint/testCerts/utcHasSeconds.pem" + inputPath := "utcHasSeconds.pem" expected := lint.Pass - out := lint.Lints["e_utc_time_does_not_include_seconds"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_utc_time_does_not_include_seconds", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUtcNoSeconds(t *testing.T) { - inputPath := "../../testlint/testCerts/utcNoSeconds.pem" + inputPath := "utcNoSeconds.pem" expected := lint.Error - out := lint.Lints["e_utc_time_does_not_include_seconds"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_utc_time_does_not_include_seconds", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_utc_time_not_in_zulu_test.go b/lints/rfc/lint_utc_time_not_in_zulu_test.go index 4b5748001..7f4a2d0e0 100644 --- a/lints/rfc/lint_utc_time_not_in_zulu_test.go +++ b/lints/rfc/lint_utc_time_not_in_zulu_test.go @@ -18,22 +18,22 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestUtcZulu(t *testing.T) { - inputPath := "../../testlint/testCerts/utcHasSeconds.pem" + inputPath := "utcHasSeconds.pem" expected := lint.Pass - out := lint.Lints["e_utc_time_not_in_zulu"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_utc_time_not_in_zulu", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUtcNotZulu(t *testing.T) { - inputPath := "../../testlint/testCerts/utcNotZulu.pem" + inputPath := "utcNotZulu.pem" expected := lint.Error - out := lint.Lints["e_utc_time_not_in_zulu"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_utc_time_not_in_zulu", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/lints/rfc/lint_wrong_time_format_pre2050_test.go b/lints/rfc/lint_wrong_time_format_pre2050_test.go index 63c5aaa8e..5d6736f8d 100644 --- a/lints/rfc/lint_wrong_time_format_pre2050_test.go +++ b/lints/rfc/lint_wrong_time_format_pre2050_test.go @@ -18,31 +18,31 @@ import ( "testing" "github.com/zmap/zlint/lint" - "github.com/zmap/zlint/util" + "github.com/zmap/zlint/test" ) func TestGeneralizedAfter2050(t *testing.T) { - inputPath := "../../testlint/testCerts/generalizedAfter2050.pem" + inputPath := "generalizedAfter2050.pem" expected := lint.Pass - out := lint.Lints["e_wrong_time_format_pre2050"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_wrong_time_format_pre2050", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestUTCPrior2050(t *testing.T) { - inputPath := "../../testlint/testCerts/orgValGoodAllFields.pem" + inputPath := "orgValGoodAllFields.pem" expected := lint.Pass - out := lint.Lints["e_wrong_time_format_pre2050"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_wrong_time_format_pre2050", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } } func TestGeneralizedPrior2050(t *testing.T) { - inputPath := "../../testlint/testCerts/generalizedPrior2050.pem" + inputPath := "generalizedPrior2050.pem" expected := lint.Error - out := lint.Lints["e_wrong_time_format_pre2050"].Execute(util.ReadCertificate(inputPath)) + out := test.TestLint("e_wrong_time_format_pre2050", inputPath) if out.Status != expected { t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status) } diff --git a/test/helpers.go b/test/helpers.go new file mode 100644 index 000000000..a346da8f9 --- /dev/null +++ b/test/helpers.go @@ -0,0 +1,98 @@ +package test + +/* + * ZLint Copyright 2020 Regents of the University of Michigan + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +// Contains resources necessary to the Unit Test Cases + +import ( + "encoding/pem" + "fmt" + "io/ioutil" + "strings" + + "github.com/zmap/zcrypto/x509" + "github.com/zmap/zlint/lint" +) + +// TestLint executes the given lintName against a certificate read from +// a testcert data file with the given filename. Filenames should be relative to +// `testdata/` and not absolute file paths. +// +// Important: TestLint is only appropriate for unit tests. It will panic if the +// lintName is not known or if the testCertFilename can not be loaded. +func TestLint(lintName string, testCertFilename string) *lint.LintResult { + return TestLintCert(lintName, ReadTestCert(testCertFilename)) +} + +func TestLintCert(lintName string, cert *x509.Certificate) *lint.LintResult { + // NOTE(@cpu): Once the `lint.Lints` is not exported this will have to be + // changed, likely to use a function like `lint.LintByName`. For now use the + // exported map directly to consolidate access to this one function instead of + // many individual lint unit tests. + l := lint.Lints[lintName] + if l == nil { + panic(fmt.Sprintf( + "Lint name %q does not exist in lint.Lints. "+ + "Did you forget to RegisterLint?\n", + lintName)) + } + + res := l.Execute(cert) + // We never expect a lint to return a nil LintResult + if res == nil { + panic(fmt.Sprintf( + "Running lint %q on test certificate generated a nil LintResult.\n", + lintName)) + } + return res +} + +// ReadTestCert loads a x509.Certificate from the given inPath which is assumed +// to be relative to `testdata/`. +// +// Important: ReadTestCert is only appropriate for unit tests. It will panic if +// the inPath file can not be loaded. +func ReadTestCert(inPath string) *x509.Certificate { + fullPath := fmt.Sprintf("../../testdata/%s", inPath) + + data, err := ioutil.ReadFile(fullPath) + if err != nil { + panic(fmt.Sprintf( + "Unable to read test certificate from %q - %q "+ + "Does a unit test have an incorrect test file name?\n", + fullPath, err)) + } + + if strings.Contains(string(data), "-BEGIN CERTIFICATE-") { + block, _ := pem.Decode(data) + if block == nil { + panic(fmt.Sprintf( + "Failed to PEM decode test certificate from %q - "+ + "Does a unit test have a buggy test cert file?\n", + fullPath)) + } + data = block.Bytes + } + + theCert, err := x509.ParseCertificate(data) + if err != nil { + panic(fmt.Sprintf( + "Failed to parse x509 test certificate from %q - "+ + "Does a unit test have a buggy test cert file?\n", + fullPath)) + } + + return theCert +} diff --git a/testlint/prepend_openssl.sh b/test/prepend_testcerts_openssl.sh similarity index 71% rename from testlint/prepend_openssl.sh rename to test/prepend_testcerts_openssl.sh index 069b1aeb7..55211301a 100755 --- a/testlint/prepend_openssl.sh +++ b/test/prepend_testcerts_openssl.sh @@ -1,4 +1,4 @@ #!/bin/bash -for f in testCerts/*; do +for f in ../testlint/testCerts/*; do openssl x509 -in $f -text -noout | cat - $f > /tmp/out && mv /tmp/out $f done diff --git a/testlint/testCerts/DNSFQDN.pem b/testdata/DNSFQDN.pem similarity index 100% rename from testlint/testCerts/DNSFQDN.pem rename to testdata/DNSFQDN.pem diff --git a/testlint/testCerts/IANBareSuffix.pem b/testdata/IANBareSuffix.pem similarity index 100% rename from testlint/testCerts/IANBareSuffix.pem rename to testdata/IANBareSuffix.pem diff --git a/testlint/testCerts/IANBareWildcard.pem b/testdata/IANBareWildcard.pem similarity index 100% rename from testlint/testCerts/IANBareWildcard.pem rename to testdata/IANBareWildcard.pem diff --git a/testlint/testCerts/IANCritical.pem b/testdata/IANCritical.pem similarity index 100% rename from testlint/testCerts/IANCritical.pem rename to testdata/IANCritical.pem diff --git a/testlint/testCerts/IANDNSIA5String.pem b/testdata/IANDNSIA5String.pem similarity index 100% rename from testlint/testCerts/IANDNSIA5String.pem rename to testdata/IANDNSIA5String.pem diff --git a/testlint/testCerts/IANDNSNotIA5String.pem b/testdata/IANDNSNotIA5String.pem similarity index 100% rename from testlint/testCerts/IANDNSNotIA5String.pem rename to testdata/IANDNSNotIA5String.pem diff --git a/testlint/testCerts/IANDNSNull.pem b/testdata/IANDNSNull.pem similarity index 100% rename from testlint/testCerts/IANDNSNull.pem rename to testdata/IANDNSNull.pem diff --git a/testlint/testCerts/IANDNSPeriod.pem b/testdata/IANDNSPeriod.pem similarity index 100% rename from testlint/testCerts/IANDNSPeriod.pem rename to testdata/IANDNSPeriod.pem diff --git a/testlint/testCerts/IANEmpty.pem b/testdata/IANEmpty.pem similarity index 100% rename from testlint/testCerts/IANEmpty.pem rename to testdata/IANEmpty.pem diff --git a/testlint/testCerts/IANEmptyDNS.pem b/testdata/IANEmptyDNS.pem similarity index 100% rename from testlint/testCerts/IANEmptyDNS.pem rename to testdata/IANEmptyDNS.pem diff --git a/testlint/testCerts/IANEmptyName.pem b/testdata/IANEmptyName.pem similarity index 100% rename from testlint/testCerts/IANEmptyName.pem rename to testdata/IANEmptyName.pem diff --git a/testlint/testCerts/IANGoodSuffix.pem b/testdata/IANGoodSuffix.pem similarity index 100% rename from testlint/testCerts/IANGoodSuffix.pem rename to testdata/IANGoodSuffix.pem diff --git a/testlint/testCerts/IANInvalidEmail.pem b/testdata/IANInvalidEmail.pem similarity index 100% rename from testlint/testCerts/IANInvalidEmail.pem rename to testdata/IANInvalidEmail.pem diff --git a/testlint/testCerts/IANNonEmptyDNS.pem b/testdata/IANNonEmptyDNS.pem similarity index 100% rename from testlint/testCerts/IANNonEmptyDNS.pem rename to testdata/IANNonEmptyDNS.pem diff --git a/testlint/testCerts/IANNotCritical.pem b/testdata/IANNotCritical.pem similarity index 100% rename from testlint/testCerts/IANNotCritical.pem rename to testdata/IANNotCritical.pem diff --git a/testlint/testCerts/IANSpaceDNSBeginning.pem b/testdata/IANSpaceDNSBeginning.pem similarity index 100% rename from testlint/testCerts/IANSpaceDNSBeginning.pem rename to testdata/IANSpaceDNSBeginning.pem diff --git a/testlint/testCerts/IANSpaceDNSEnd.pem b/testdata/IANSpaceDNSEnd.pem similarity index 100% rename from testlint/testCerts/IANSpaceDNSEnd.pem rename to testdata/IANSpaceDNSEnd.pem diff --git a/testlint/testCerts/IANURIHostAsterisk.pem b/testdata/IANURIHostAsterisk.pem similarity index 100% rename from testlint/testCerts/IANURIHostAsterisk.pem rename to testdata/IANURIHostAsterisk.pem diff --git a/testlint/testCerts/IANURIHostFQDN.pem b/testdata/IANURIHostFQDN.pem similarity index 100% rename from testlint/testCerts/IANURIHostFQDN.pem rename to testdata/IANURIHostFQDN.pem diff --git a/testlint/testCerts/IANURIHostIP.pem b/testdata/IANURIHostIP.pem similarity index 100% rename from testlint/testCerts/IANURIHostIP.pem rename to testdata/IANURIHostIP.pem diff --git a/testlint/testCerts/IANURIHostNotFQDNOrIP.pem b/testdata/IANURIHostNotFQDNOrIP.pem similarity index 100% rename from testlint/testCerts/IANURIHostNotFQDNOrIP.pem rename to testdata/IANURIHostNotFQDNOrIP.pem diff --git a/testlint/testCerts/IANURIHostWildcardFQDN.pem b/testdata/IANURIHostWildcardFQDN.pem similarity index 100% rename from testlint/testCerts/IANURIHostWildcardFQDN.pem rename to testdata/IANURIHostWildcardFQDN.pem diff --git a/testlint/testCerts/IANURIHostWrongWildcard.pem b/testdata/IANURIHostWrongWildcard.pem similarity index 100% rename from testlint/testCerts/IANURIHostWrongWildcard.pem rename to testdata/IANURIHostWrongWildcard.pem diff --git a/testlint/testCerts/IANURIIA5String.pem b/testdata/IANURIIA5String.pem similarity index 100% rename from testlint/testCerts/IANURIIA5String.pem rename to testdata/IANURIIA5String.pem diff --git a/testlint/testCerts/IANURINoScheme.pem b/testdata/IANURINoScheme.pem similarity index 100% rename from testlint/testCerts/IANURINoScheme.pem rename to testdata/IANURINoScheme.pem diff --git a/testlint/testCerts/IANURINoSchemeSpecificPart.pem b/testdata/IANURINoSchemeSpecificPart.pem similarity index 100% rename from testlint/testCerts/IANURINoSchemeSpecificPart.pem rename to testdata/IANURINoSchemeSpecificPart.pem diff --git a/testlint/testCerts/IANURINotIA5String.pem b/testdata/IANURINotIA5String.pem similarity index 100% rename from testlint/testCerts/IANURINotIA5String.pem rename to testdata/IANURINotIA5String.pem diff --git a/testlint/testCerts/IANURIValid.pem b/testdata/IANURIValid.pem similarity index 100% rename from testlint/testCerts/IANURIValid.pem rename to testdata/IANURIValid.pem diff --git a/testlint/testCerts/IANValidEmail.pem b/testdata/IANValidEmail.pem similarity index 100% rename from testlint/testCerts/IANValidEmail.pem rename to testdata/IANValidEmail.pem diff --git a/testlint/testCerts/IANWildcardFirst.pem b/testdata/IANWildcardFirst.pem similarity index 100% rename from testlint/testCerts/IANWildcardFirst.pem rename to testdata/IANWildcardFirst.pem diff --git a/testlint/testCerts/IssuerDNCountryNotPrintableString.pem b/testdata/IssuerDNCountryNotPrintableString.pem similarity index 100% rename from testlint/testCerts/IssuerDNCountryNotPrintableString.pem rename to testdata/IssuerDNCountryNotPrintableString.pem diff --git a/testlint/testCerts/NameConstraintCA.pem b/testdata/NameConstraintCA.pem similarity index 100% rename from testlint/testCerts/NameConstraintCA.pem rename to testdata/NameConstraintCA.pem diff --git a/testlint/testCerts/NameConstraintCrit.pem b/testdata/NameConstraintCrit.pem similarity index 100% rename from testlint/testCerts/NameConstraintCrit.pem rename to testdata/NameConstraintCrit.pem diff --git a/testlint/testCerts/NameConstraintNotCA.pem b/testdata/NameConstraintNotCA.pem similarity index 100% rename from testlint/testCerts/NameConstraintNotCA.pem rename to testdata/NameConstraintNotCA.pem diff --git a/testlint/testCerts/NameConstraintNotCrit.pem b/testdata/NameConstraintNotCrit.pem similarity index 100% rename from testlint/testCerts/NameConstraintNotCrit.pem rename to testdata/NameConstraintNotCrit.pem diff --git a/testlint/testCerts/QcStmtEtsiEsealValidCert02.pem b/testdata/QcStmtEtsiEsealValidCert02.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiEsealValidCert02.pem rename to testdata/QcStmtEtsiEsealValidCert02.pem diff --git a/testlint/testCerts/QcStmtEtsiLangCodeUpperCaseCert23.pem b/testdata/QcStmtEtsiLangCodeUpperCaseCert23.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiLangCodeUpperCaseCert23.pem rename to testdata/QcStmtEtsiLangCodeUpperCaseCert23.pem diff --git a/testlint/testCerts/QcStmtEtsiMissingEnglishPdsCert04.pem b/testdata/QcStmtEtsiMissingEnglishPdsCert04.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiMissingEnglishPdsCert04.pem rename to testdata/QcStmtEtsiMissingEnglishPdsCert04.pem diff --git a/testlint/testCerts/QcStmtEtsiMissingMandatoryCert14.pem b/testdata/QcStmtEtsiMissingMandatoryCert14.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiMissingMandatoryCert14.pem rename to testdata/QcStmtEtsiMissingMandatoryCert14.pem diff --git a/testlint/testCerts/QcStmtEtsiMissingOidCert09.pem b/testdata/QcStmtEtsiMissingOidCert09.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiMissingOidCert09.pem rename to testdata/QcStmtEtsiMissingOidCert09.pem diff --git a/testlint/testCerts/QcStmtEtsiMissingPDSCert16.pem b/testdata/QcStmtEtsiMissingPDSCert16.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiMissingPDSCert16.pem rename to testdata/QcStmtEtsiMissingPDSCert16.pem diff --git a/testlint/testCerts/QcStmtEtsiMissingSeqForQcTypesCert18.pem b/testdata/QcStmtEtsiMissingSeqForQcTypesCert18.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiMissingSeqForQcTypesCert18.pem rename to testdata/QcStmtEtsiMissingSeqForQcTypesCert18.pem diff --git a/testlint/testCerts/QcStmtEtsiNoQcStatmentsCert22.pem b/testdata/QcStmtEtsiNoQcStatmentsCert22.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiNoQcStatmentsCert22.pem rename to testdata/QcStmtEtsiNoQcStatmentsCert22.pem diff --git a/testlint/testCerts/QcStmtEtsiNumberInLangCodeCert21.pem b/testdata/QcStmtEtsiNumberInLangCodeCert21.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiNumberInLangCodeCert21.pem rename to testdata/QcStmtEtsiNumberInLangCodeCert21.pem diff --git a/testlint/testCerts/QcStmtEtsiQcComplWithNonEmptyStmtInfoCert19.pem b/testdata/QcStmtEtsiQcComplWithNonEmptyStmtInfoCert19.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiQcComplWithNonEmptyStmtInfoCert19.pem rename to testdata/QcStmtEtsiQcComplWithNonEmptyStmtInfoCert19.pem diff --git a/testlint/testCerts/QcStmtEtsiQcTypeAsQcStmtCert10.pem b/testdata/QcStmtEtsiQcTypeAsQcStmtCert10.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiQcTypeAsQcStmtCert10.pem rename to testdata/QcStmtEtsiQcTypeAsQcStmtCert10.pem diff --git a/testlint/testCerts/QcStmtEtsiTaggedValueCert20.pem b/testdata/QcStmtEtsiTaggedValueCert20.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiTaggedValueCert20.pem rename to testdata/QcStmtEtsiTaggedValueCert20.pem diff --git a/testlint/testCerts/QcStmtEtsiTwoEnglPdsCert12.pem b/testdata/QcStmtEtsiTwoEnglPdsCert12.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiTwoEnglPdsCert12.pem rename to testdata/QcStmtEtsiTwoEnglPdsCert12.pem diff --git a/testlint/testCerts/QcStmtEtsiTwoLangCodesCert17.pem b/testdata/QcStmtEtsiTwoLangCodesCert17.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiTwoLangCodesCert17.pem rename to testdata/QcStmtEtsiTwoLangCodesCert17.pem diff --git a/testlint/testCerts/QcStmtEtsiTwoQcTypesCert15.pem b/testdata/QcStmtEtsiTwoQcTypesCert15.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiTwoQcTypesCert15.pem rename to testdata/QcStmtEtsiTwoQcTypesCert15.pem diff --git a/testlint/testCerts/QcStmtEtsiValidAddLangCert13.pem b/testdata/QcStmtEtsiValidAddLangCert13.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiValidAddLangCert13.pem rename to testdata/QcStmtEtsiValidAddLangCert13.pem diff --git a/testlint/testCerts/QcStmtEtsiValidCert03.pem b/testdata/QcStmtEtsiValidCert03.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiValidCert03.pem rename to testdata/QcStmtEtsiValidCert03.pem diff --git a/testlint/testCerts/QcStmtEtsiValidCert11.pem b/testdata/QcStmtEtsiValidCert11.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiValidCert11.pem rename to testdata/QcStmtEtsiValidCert11.pem diff --git a/testlint/testCerts/QcStmtEtsiValidCert24.pem b/testdata/QcStmtEtsiValidCert24.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiValidCert24.pem rename to testdata/QcStmtEtsiValidCert24.pem diff --git a/testlint/testCerts/QcStmtEtsiWrongCriticalityCert06.pem b/testdata/QcStmtEtsiWrongCriticalityCert06.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiWrongCriticalityCert06.pem rename to testdata/QcStmtEtsiWrongCriticalityCert06.pem diff --git a/testlint/testCerts/QcStmtEtsiWrongEncodingCert01.pem b/testdata/QcStmtEtsiWrongEncodingCert01.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiWrongEncodingCert01.pem rename to testdata/QcStmtEtsiWrongEncodingCert01.pem diff --git a/testlint/testCerts/QcStmtEtsiWrongEncodingLangCodeCert07.pem b/testdata/QcStmtEtsiWrongEncodingLangCodeCert07.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiWrongEncodingLangCodeCert07.pem rename to testdata/QcStmtEtsiWrongEncodingLangCodeCert07.pem diff --git a/testlint/testCerts/QcStmtEtsiWrongEncodingUrlCert08.pem b/testdata/QcStmtEtsiWrongEncodingUrlCert08.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiWrongEncodingUrlCert08.pem rename to testdata/QcStmtEtsiWrongEncodingUrlCert08.pem diff --git a/testlint/testCerts/QcStmtEtsiWrongLangCodeCert05.pem b/testdata/QcStmtEtsiWrongLangCodeCert05.pem similarity index 100% rename from testlint/testCerts/QcStmtEtsiWrongLangCodeCert05.pem rename to testdata/QcStmtEtsiWrongLangCodeCert05.pem diff --git a/testlint/testCerts/QcStmtInvalidLimitValue.pem b/testdata/QcStmtInvalidLimitValue.pem similarity index 100% rename from testlint/testCerts/QcStmtInvalidLimitValue.pem rename to testdata/QcStmtInvalidLimitValue.pem diff --git a/testlint/testCerts/QcStmtValidLimitValue.pem b/testdata/QcStmtValidLimitValue.pem similarity index 100% rename from testlint/testCerts/QcStmtValidLimitValue.pem rename to testdata/QcStmtValidLimitValue.pem diff --git a/testlint/testCerts/RFC5280example2.pem b/testdata/RFC5280example2.pem similarity index 100% rename from testlint/testCerts/RFC5280example2.pem rename to testdata/RFC5280example2.pem diff --git a/testlint/testCerts/RSASHA1Good.pem b/testdata/RSASHA1Good.pem similarity index 100% rename from testlint/testCerts/RSASHA1Good.pem rename to testdata/RSASHA1Good.pem diff --git a/testlint/testCerts/SANBareSuffix.pem b/testdata/SANBareSuffix.pem similarity index 100% rename from testlint/testCerts/SANBareSuffix.pem rename to testdata/SANBareSuffix.pem diff --git a/testlint/testCerts/SANBareWildcard.pem b/testdata/SANBareWildcard.pem similarity index 100% rename from testlint/testCerts/SANBareWildcard.pem rename to testdata/SANBareWildcard.pem diff --git a/testlint/testCerts/SANCaGood.pem b/testdata/SANCaGood.pem similarity index 100% rename from testlint/testCerts/SANCaGood.pem rename to testdata/SANCaGood.pem diff --git a/testlint/testCerts/SANCaseNotMatchingCN.pem b/testdata/SANCaseNotMatchingCN.pem similarity index 100% rename from testlint/testCerts/SANCaseNotMatchingCN.pem rename to testdata/SANCaseNotMatchingCN.pem diff --git a/testlint/testCerts/SANCriticalSubjectUncommonOnly.pem b/testdata/SANCriticalSubjectUncommonOnly.pem similarity index 100% rename from testlint/testCerts/SANCriticalSubjectUncommonOnly.pem rename to testdata/SANCriticalSubjectUncommonOnly.pem diff --git a/testlint/testCerts/SANDNSAsterisk.pem b/testdata/SANDNSAsterisk.pem similarity index 100% rename from testlint/testCerts/SANDNSAsterisk.pem rename to testdata/SANDNSAsterisk.pem diff --git a/testlint/testCerts/SANDNSDuplicate.pem b/testdata/SANDNSDuplicate.pem similarity index 100% rename from testlint/testCerts/SANDNSDuplicate.pem rename to testdata/SANDNSDuplicate.pem diff --git a/testlint/testCerts/SANDNSNameNotFQDN.pem b/testdata/SANDNSNameNotFQDN.pem similarity index 100% rename from testlint/testCerts/SANDNSNameNotFQDN.pem rename to testdata/SANDNSNameNotFQDN.pem diff --git a/testlint/testCerts/SANDNSNotIA5String.pem b/testdata/SANDNSNotIA5String.pem similarity index 100% rename from testlint/testCerts/SANDNSNotIA5String.pem rename to testdata/SANDNSNotIA5String.pem diff --git a/testlint/testCerts/SANDNSNull.pem b/testdata/SANDNSNull.pem similarity index 100% rename from testlint/testCerts/SANDNSNull.pem rename to testdata/SANDNSNull.pem diff --git a/testlint/testCerts/SANDNSPeriod.pem b/testdata/SANDNSPeriod.pem similarity index 100% rename from testlint/testCerts/SANDNSPeriod.pem rename to testdata/SANDNSPeriod.pem diff --git a/testlint/testCerts/SANDNSTooLong.pem b/testdata/SANDNSTooLong.pem similarity index 100% rename from testlint/testCerts/SANDNSTooLong.pem rename to testdata/SANDNSTooLong.pem diff --git a/testlint/testCerts/SANDNSWildcard.pem b/testdata/SANDNSWildcard.pem similarity index 100% rename from testlint/testCerts/SANDNSWildcard.pem rename to testdata/SANDNSWildcard.pem diff --git a/testlint/testCerts/SANDNSWrongWildcard.pem b/testdata/SANDNSWrongWildcard.pem similarity index 100% rename from testlint/testCerts/SANDNSWrongWildcard.pem rename to testdata/SANDNSWrongWildcard.pem diff --git a/testlint/testCerts/SANDirectoryNameBeginning.pem b/testdata/SANDirectoryNameBeginning.pem similarity index 100% rename from testlint/testCerts/SANDirectoryNameBeginning.pem rename to testdata/SANDirectoryNameBeginning.pem diff --git a/testlint/testCerts/SANDirectoryNameEnd.pem b/testdata/SANDirectoryNameEnd.pem similarity index 100% rename from testlint/testCerts/SANDirectoryNameEnd.pem rename to testdata/SANDirectoryNameEnd.pem diff --git a/testlint/testCerts/SANEDIParty.pem b/testdata/SANEDIParty.pem similarity index 100% rename from testlint/testCerts/SANEDIParty.pem rename to testdata/SANEDIParty.pem diff --git a/testlint/testCerts/SANEmptyName.pem b/testdata/SANEmptyName.pem similarity index 100% rename from testlint/testCerts/SANEmptyName.pem rename to testdata/SANEmptyName.pem diff --git a/testlint/testCerts/SANGoodSuffix.pem b/testdata/SANGoodSuffix.pem similarity index 100% rename from testlint/testCerts/SANGoodSuffix.pem rename to testdata/SANGoodSuffix.pem diff --git a/testlint/testCerts/SANNoEntries.pem b/testdata/SANNoEntries.pem similarity index 100% rename from testlint/testCerts/SANNoEntries.pem rename to testdata/SANNoEntries.pem diff --git a/testlint/testCerts/SANNotCriticalSubjectUncommonOnly.pem b/testdata/SANNotCriticalSubjectUncommonOnly.pem similarity index 100% rename from testlint/testCerts/SANNotCriticalSubjectUncommonOnly.pem rename to testdata/SANNotCriticalSubjectUncommonOnly.pem diff --git a/testlint/testCerts/SANOtherName.pem b/testdata/SANOtherName.pem similarity index 100% rename from testlint/testCerts/SANOtherName.pem rename to testdata/SANOtherName.pem diff --git a/testlint/testCerts/SANRFC822Beginning.pem b/testdata/SANRFC822Beginning.pem similarity index 100% rename from testlint/testCerts/SANRFC822Beginning.pem rename to testdata/SANRFC822Beginning.pem diff --git a/testlint/testCerts/SANRFC822End.pem b/testdata/SANRFC822End.pem similarity index 100% rename from testlint/testCerts/SANRFC822End.pem rename to testdata/SANRFC822End.pem diff --git a/testlint/testCerts/SANRegisteredIdBeginning.pem b/testdata/SANRegisteredIdBeginning.pem similarity index 100% rename from testlint/testCerts/SANRegisteredIdBeginning.pem rename to testdata/SANRegisteredIdBeginning.pem diff --git a/testlint/testCerts/SANRegisteredIdEnd.pem b/testdata/SANRegisteredIdEnd.pem similarity index 100% rename from testlint/testCerts/SANRegisteredIdEnd.pem rename to testdata/SANRegisteredIdEnd.pem diff --git a/testlint/testCerts/SANReservedIP.pem b/testdata/SANReservedIP.pem similarity index 100% rename from testlint/testCerts/SANReservedIP.pem rename to testdata/SANReservedIP.pem diff --git a/testlint/testCerts/SANReservedIP6.pem b/testdata/SANReservedIP6.pem similarity index 100% rename from testlint/testCerts/SANReservedIP6.pem rename to testdata/SANReservedIP6.pem diff --git a/testlint/testCerts/SANSubjectEmptyNotCritical.pem b/testdata/SANSubjectEmptyNotCritical.pem similarity index 100% rename from testlint/testCerts/SANSubjectEmptyNotCritical.pem rename to testdata/SANSubjectEmptyNotCritical.pem diff --git a/testlint/testCerts/SANURIAbsolute.pem b/testdata/SANURIAbsolute.pem similarity index 100% rename from testlint/testCerts/SANURIAbsolute.pem rename to testdata/SANURIAbsolute.pem diff --git a/testlint/testCerts/SANURIBeginning.pem b/testdata/SANURIBeginning.pem similarity index 100% rename from testlint/testCerts/SANURIBeginning.pem rename to testdata/SANURIBeginning.pem diff --git a/testlint/testCerts/SANURIEnd.pem b/testdata/SANURIEnd.pem similarity index 100% rename from testlint/testCerts/SANURIEnd.pem rename to testdata/SANURIEnd.pem diff --git a/testlint/testCerts/SANURIFQDN.pem b/testdata/SANURIFQDN.pem similarity index 100% rename from testlint/testCerts/SANURIFQDN.pem rename to testdata/SANURIFQDN.pem diff --git a/testlint/testCerts/SANURIHostAsterisk.pem b/testdata/SANURIHostAsterisk.pem similarity index 100% rename from testlint/testCerts/SANURIHostAsterisk.pem rename to testdata/SANURIHostAsterisk.pem diff --git a/testlint/testCerts/SANURIHostFQDN.pem b/testdata/SANURIHostFQDN.pem similarity index 100% rename from testlint/testCerts/SANURIHostFQDN.pem rename to testdata/SANURIHostFQDN.pem diff --git a/testlint/testCerts/SANURIHostWildcardFQDN.pem b/testdata/SANURIHostWildcardFQDN.pem similarity index 100% rename from testlint/testCerts/SANURIHostWildcardFQDN.pem rename to testdata/SANURIHostWildcardFQDN.pem diff --git a/testlint/testCerts/SANURIHostWrongWildcard.pem b/testdata/SANURIHostWrongWildcard.pem similarity index 100% rename from testlint/testCerts/SANURIHostWrongWildcard.pem rename to testdata/SANURIHostWrongWildcard.pem diff --git a/testlint/testCerts/SANURIIA5.pem b/testdata/SANURIIA5.pem similarity index 100% rename from testlint/testCerts/SANURIIA5.pem rename to testdata/SANURIIA5.pem diff --git a/testlint/testCerts/SANURIIP.pem b/testdata/SANURIIP.pem similarity index 100% rename from testlint/testCerts/SANURIIP.pem rename to testdata/SANURIIP.pem diff --git a/testlint/testCerts/SANURINoAuthority.pem b/testdata/SANURINoAuthority.pem similarity index 100% rename from testlint/testCerts/SANURINoAuthority.pem rename to testdata/SANURINoAuthority.pem diff --git a/testlint/testCerts/SANURINoScheme.pem b/testdata/SANURINoScheme.pem similarity index 100% rename from testlint/testCerts/SANURINoScheme.pem rename to testdata/SANURINoScheme.pem diff --git a/testlint/testCerts/SANURINoSchemeSpecificPart.pem b/testdata/SANURINoSchemeSpecificPart.pem similarity index 100% rename from testlint/testCerts/SANURINoSchemeSpecificPart.pem rename to testdata/SANURINoSchemeSpecificPart.pem diff --git a/testlint/testCerts/SANURINotFQDN.pem b/testdata/SANURINotFQDN.pem similarity index 100% rename from testlint/testCerts/SANURINotFQDN.pem rename to testdata/SANURINotFQDN.pem diff --git a/testlint/testCerts/SANURINotIA5.pem b/testdata/SANURINotIA5.pem similarity index 100% rename from testlint/testCerts/SANURINotIA5.pem rename to testdata/SANURINotIA5.pem diff --git a/testlint/testCerts/SANURIRelative.pem b/testdata/SANURIRelative.pem similarity index 100% rename from testlint/testCerts/SANURIRelative.pem rename to testdata/SANURIRelative.pem diff --git a/testlint/testCerts/SANURIValid.pem b/testdata/SANURIValid.pem similarity index 100% rename from testlint/testCerts/SANURIValid.pem rename to testdata/SANURIValid.pem diff --git a/testlint/testCerts/SANValidIP.pem b/testdata/SANValidIP.pem similarity index 100% rename from testlint/testCerts/SANValidIP.pem rename to testdata/SANValidIP.pem diff --git a/testlint/testCerts/SANWildcardFirst.pem b/testdata/SANWildcardFirst.pem similarity index 100% rename from testlint/testCerts/SANWildcardFirst.pem rename to testdata/SANWildcardFirst.pem diff --git a/testlint/testCerts/SANWithInvalidEmail.pem b/testdata/SANWithInvalidEmail.pem similarity index 100% rename from testlint/testCerts/SANWithInvalidEmail.pem rename to testdata/SANWithInvalidEmail.pem diff --git a/testlint/testCerts/SANWithInvalidEmail2.pem b/testdata/SANWithInvalidEmail2.pem similarity index 100% rename from testlint/testCerts/SANWithInvalidEmail2.pem rename to testdata/SANWithInvalidEmail2.pem diff --git a/testlint/testCerts/SANWithMissingCN.pem b/testdata/SANWithMissingCN.pem similarity index 100% rename from testlint/testCerts/SANWithMissingCN.pem rename to testdata/SANWithMissingCN.pem diff --git a/testlint/testCerts/SANWithSpaceDNS.pem b/testdata/SANWithSpaceDNS.pem similarity index 100% rename from testlint/testCerts/SANWithSpaceDNS.pem rename to testdata/SANWithSpaceDNS.pem diff --git a/testlint/testCerts/SANWithSpaceDNSBeginning.pem b/testdata/SANWithSpaceDNSBeginning.pem similarity index 100% rename from testlint/testCerts/SANWithSpaceDNSBeginning.pem rename to testdata/SANWithSpaceDNSBeginning.pem diff --git a/testlint/testCerts/SANWithSpaceDNSCenter.pem b/testdata/SANWithSpaceDNSCenter.pem similarity index 100% rename from testlint/testCerts/SANWithSpaceDNSCenter.pem rename to testdata/SANWithSpaceDNSCenter.pem diff --git a/testlint/testCerts/SANWithSpaceDNSEnd.pem b/testdata/SANWithSpaceDNSEnd.pem similarity index 100% rename from testlint/testCerts/SANWithSpaceDNSEnd.pem rename to testdata/SANWithSpaceDNSEnd.pem diff --git a/testlint/testCerts/SANWithSpaceRFC822Center.pem b/testdata/SANWithSpaceRFC822Center.pem similarity index 100% rename from testlint/testCerts/SANWithSpaceRFC822Center.pem rename to testdata/SANWithSpaceRFC822Center.pem diff --git a/testlint/testCerts/SANWithValidEmail.pem b/testdata/SANWithValidEmail.pem similarity index 100% rename from testlint/testCerts/SANWithValidEmail.pem rename to testdata/SANWithValidEmail.pem diff --git a/testlint/testCerts/SANdnsbadsyntax.pem b/testdata/SANdnsbadsyntax.pem similarity index 100% rename from testlint/testCerts/SANdnsbadsyntax.pem rename to testdata/SANdnsbadsyntax.pem diff --git a/testlint/testCerts/SANdnsdollarsyntax.pem b/testdata/SANdnsdollarsyntax.pem similarity index 100% rename from testlint/testCerts/SANdnsdollarsyntax.pem rename to testdata/SANdnsdollarsyntax.pem diff --git a/testlint/testCerts/SANdnsgoodsyntax.pem b/testdata/SANdnsgoodsyntax.pem similarity index 100% rename from testlint/testCerts/SANdnsgoodsyntax.pem rename to testdata/SANdnsgoodsyntax.pem diff --git a/testlint/testCerts/SANdnshyphensyntax.pem b/testdata/SANdnshyphensyntax.pem similarity index 100% rename from testlint/testCerts/SANdnshyphensyntax.pem rename to testdata/SANdnshyphensyntax.pem diff --git a/testlint/testCerts/SubjectDNAndIssuerDNCountryPrintableString.pem b/testdata/SubjectDNAndIssuerDNCountryPrintableString.pem similarity index 100% rename from testlint/testCerts/SubjectDNAndIssuerDNCountryPrintableString.pem rename to testdata/SubjectDNAndIssuerDNCountryPrintableString.pem diff --git a/testlint/testCerts/SubjectDNCountryNotPrintableString.pem b/testdata/SubjectDNCountryNotPrintableString.pem similarity index 100% rename from testlint/testCerts/SubjectDNCountryNotPrintableString.pem rename to testdata/SubjectDNCountryNotPrintableString.pem diff --git a/testlint/testCerts/SubjectDNSerialNumberNotPrintableString.pem b/testdata/SubjectDNSerialNumberNotPrintableString.pem similarity index 100% rename from testlint/testCerts/SubjectDNSerialNumberNotPrintableString.pem rename to testdata/SubjectDNSerialNumberNotPrintableString.pem diff --git a/testlint/testCerts/SubjectDNSerialNumberTooLong.pem b/testdata/SubjectDNSerialNumberTooLong.pem similarity index 100% rename from testlint/testCerts/SubjectDNSerialNumberTooLong.pem rename to testdata/SubjectDNSerialNumberTooLong.pem diff --git a/testlint/testCerts/SubjectEmailToolLong.pem b/testdata/SubjectEmailToolLong.pem similarity index 100% rename from testlint/testCerts/SubjectEmailToolLong.pem rename to testdata/SubjectEmailToolLong.pem diff --git a/testlint/testCerts/aiaCrit.pem b/testdata/aiaCrit.pem similarity index 100% rename from testlint/testCerts/aiaCrit.pem rename to testdata/aiaCrit.pem diff --git a/testlint/testCerts/akiCritical.pem b/testdata/akiCritical.pem similarity index 100% rename from testlint/testCerts/akiCritical.pem rename to testdata/akiCritical.pem diff --git a/testlint/testCerts/akiMissing.pem b/testdata/akiMissing.pem similarity index 100% rename from testlint/testCerts/akiMissing.pem rename to testdata/akiMissing.pem diff --git a/testlint/testCerts/akiNoKeyIdentifier.pem b/testdata/akiNoKeyIdentifier.pem similarity index 100% rename from testlint/testCerts/akiNoKeyIdentifier.pem rename to testdata/akiNoKeyIdentifier.pem diff --git a/testlint/testCerts/akiWithSerial.pem b/testdata/akiWithSerial.pem similarity index 100% rename from testlint/testCerts/akiWithSerial.pem rename to testdata/akiWithSerial.pem diff --git a/testlint/testCerts/akidNoKeyIdentifier.pem b/testdata/akidNoKeyIdentifier.pem similarity index 100% rename from testlint/testCerts/akidNoKeyIdentifier.pem rename to testdata/akidNoKeyIdentifier.pem diff --git a/testlint/testCerts/akidWithKeyID.pem b/testdata/akidWithKeyID.pem similarity index 100% rename from testlint/testCerts/akidWithKeyID.pem rename to testdata/akidWithKeyID.pem diff --git a/testlint/testCerts/allUIDv1.pem b/testdata/allUIDv1.pem similarity index 100% rename from testlint/testCerts/allUIDv1.pem rename to testdata/allUIDv1.pem diff --git a/testlint/testCerts/allUIDv2.pem b/testdata/allUIDv2.pem similarity index 100% rename from testlint/testCerts/allUIDv2.pem rename to testdata/allUIDv2.pem diff --git a/testlint/testCerts/badRsaExp.pem b/testdata/badRsaExp.pem similarity index 100% rename from testlint/testCerts/badRsaExp.pem rename to testdata/badRsaExp.pem diff --git a/testlint/testCerts/badRsaExpLength.pem b/testdata/badRsaExpLength.pem similarity index 100% rename from testlint/testCerts/badRsaExpLength.pem rename to testdata/badRsaExpLength.pem diff --git a/testlint/testCerts/caBasicConstCrit.pem b/testdata/caBasicConstCrit.pem similarity index 100% rename from testlint/testCerts/caBasicConstCrit.pem rename to testdata/caBasicConstCrit.pem diff --git a/testlint/testCerts/caBasicConstMissing.pem b/testdata/caBasicConstMissing.pem similarity index 100% rename from testlint/testCerts/caBasicConstMissing.pem rename to testdata/caBasicConstMissing.pem diff --git a/testlint/testCerts/caBasicConstNotCrit.pem b/testdata/caBasicConstNotCrit.pem similarity index 100% rename from testlint/testCerts/caBasicConstNotCrit.pem rename to testdata/caBasicConstNotCrit.pem diff --git a/testlint/testCerts/caBlankCountry.pem b/testdata/caBlankCountry.pem similarity index 100% rename from testlint/testCerts/caBlankCountry.pem rename to testdata/caBlankCountry.pem diff --git a/testlint/testCerts/caCommonNameMissing.pem b/testdata/caCommonNameMissing.pem similarity index 100% rename from testlint/testCerts/caCommonNameMissing.pem rename to testdata/caCommonNameMissing.pem diff --git a/testlint/testCerts/caCommonNameNotMissing.pem b/testdata/caCommonNameNotMissing.pem similarity index 100% rename from testlint/testCerts/caCommonNameNotMissing.pem rename to testdata/caCommonNameNotMissing.pem diff --git a/testlint/testCerts/caInvalCountryCode.pem b/testdata/caInvalCountryCode.pem similarity index 100% rename from testlint/testCerts/caInvalCountryCode.pem rename to testdata/caInvalCountryCode.pem diff --git a/testlint/testCerts/caIssuerBlank.pem b/testdata/caIssuerBlank.pem similarity index 100% rename from testlint/testCerts/caIssuerBlank.pem rename to testdata/caIssuerBlank.pem diff --git a/testlint/testCerts/caIssuerHTTP.pem b/testdata/caIssuerHTTP.pem similarity index 100% rename from testlint/testCerts/caIssuerHTTP.pem rename to testdata/caIssuerHTTP.pem diff --git a/testlint/testCerts/caIssuerLDAP.pem b/testdata/caIssuerLDAP.pem similarity index 100% rename from testlint/testCerts/caIssuerLDAP.pem rename to testdata/caIssuerLDAP.pem diff --git a/testlint/testCerts/caIssuerNoHTTPLDAP.pem b/testdata/caIssuerNoHTTPLDAP.pem similarity index 100% rename from testlint/testCerts/caIssuerNoHTTPLDAP.pem rename to testdata/caIssuerNoHTTPLDAP.pem diff --git a/testlint/testCerts/caKeyUsageCrit.pem b/testdata/caKeyUsageCrit.pem similarity index 100% rename from testlint/testCerts/caKeyUsageCrit.pem rename to testdata/caKeyUsageCrit.pem diff --git a/testlint/testCerts/caKeyUsageMissing.pem b/testdata/caKeyUsageMissing.pem similarity index 100% rename from testlint/testCerts/caKeyUsageMissing.pem rename to testdata/caKeyUsageMissing.pem diff --git a/testlint/testCerts/caKeyUsageNoCRL.pem b/testdata/caKeyUsageNoCRL.pem similarity index 100% rename from testlint/testCerts/caKeyUsageNoCRL.pem rename to testdata/caKeyUsageNoCRL.pem diff --git a/testlint/testCerts/caKeyUsageNoCertSign.pem b/testdata/caKeyUsageNoCertSign.pem similarity index 100% rename from testlint/testCerts/caKeyUsageNoCertSign.pem rename to testdata/caKeyUsageNoCertSign.pem diff --git a/testlint/testCerts/caKeyUsageNotCrit.pem b/testdata/caKeyUsageNotCrit.pem similarity index 100% rename from testlint/testCerts/caKeyUsageNotCrit.pem rename to testdata/caKeyUsageNotCrit.pem diff --git a/testlint/testCerts/caKeyUsageWDigSign.pem b/testdata/caKeyUsageWDigSign.pem similarity index 100% rename from testlint/testCerts/caKeyUsageWDigSign.pem rename to testdata/caKeyUsageWDigSign.pem diff --git a/testlint/testCerts/caMaxPathLenMissing.pem b/testdata/caMaxPathLenMissing.pem similarity index 100% rename from testlint/testCerts/caMaxPathLenMissing.pem rename to testdata/caMaxPathLenMissing.pem diff --git a/testlint/testCerts/caMaxPathLenPositive.pem b/testdata/caMaxPathLenPositive.pem similarity index 100% rename from testlint/testCerts/caMaxPathLenPositive.pem rename to testdata/caMaxPathLenPositive.pem diff --git a/testlint/testCerts/caMaxPathLenPresentNoCertSign.pem b/testdata/caMaxPathLenPresentNoCertSign.pem similarity index 100% rename from testlint/testCerts/caMaxPathLenPresentNoCertSign.pem rename to testdata/caMaxPathLenPresentNoCertSign.pem diff --git a/testlint/testCerts/caMaxPathNegative.pem b/testdata/caMaxPathNegative.pem similarity index 100% rename from testlint/testCerts/caMaxPathNegative.pem rename to testdata/caMaxPathNegative.pem diff --git a/testlint/testCerts/caOrgNameEmpty.pem b/testdata/caOrgNameEmpty.pem similarity index 100% rename from testlint/testCerts/caOrgNameEmpty.pem rename to testdata/caOrgNameEmpty.pem diff --git a/testlint/testCerts/caOrgNameMissing.pem b/testdata/caOrgNameMissing.pem similarity index 100% rename from testlint/testCerts/caOrgNameMissing.pem rename to testdata/caOrgNameMissing.pem diff --git a/testlint/testCerts/caSubjectEmpty.pem b/testdata/caSubjectEmpty.pem similarity index 100% rename from testlint/testCerts/caSubjectEmpty.pem rename to testdata/caSubjectEmpty.pem diff --git a/testlint/testCerts/caSubjectMissing.pem b/testdata/caSubjectMissing.pem similarity index 100% rename from testlint/testCerts/caSubjectMissing.pem rename to testdata/caSubjectMissing.pem diff --git a/testlint/testCerts/caValCountry.pem b/testdata/caValCountry.pem similarity index 100% rename from testlint/testCerts/caValCountry.pem rename to testdata/caValCountry.pem diff --git a/testlint/testCerts/caValOrgName.pem b/testdata/caValOrgName.pem similarity index 100% rename from testlint/testCerts/caValOrgName.pem rename to testdata/caValOrgName.pem diff --git a/testlint/testCerts/certPolicyAssertionDuplicated.pem b/testdata/certPolicyAssertionDuplicated.pem similarity index 100% rename from testlint/testCerts/certPolicyAssertionDuplicated.pem rename to testdata/certPolicyAssertionDuplicated.pem diff --git a/testlint/testCerts/certPolicyDuplicateShort.pem b/testdata/certPolicyDuplicateShort.pem similarity index 100% rename from testlint/testCerts/certPolicyDuplicateShort.pem rename to testdata/certPolicyDuplicateShort.pem diff --git a/testlint/testCerts/certPolicyNoDuplicate.pem b/testdata/certPolicyNoDuplicate.pem similarity index 100% rename from testlint/testCerts/certPolicyNoDuplicate.pem rename to testdata/certPolicyNoDuplicate.pem diff --git a/testlint/testCerts/certVersion1NoExtensions.pem b/testdata/certVersion1NoExtensions.pem similarity index 100% rename from testlint/testCerts/certVersion1NoExtensions.pem rename to testdata/certVersion1NoExtensions.pem diff --git a/testlint/testCerts/certVersion2NoExtensions.pem b/testdata/certVersion2NoExtensions.pem similarity index 100% rename from testlint/testCerts/certVersion2NoExtensions.pem rename to testdata/certVersion2NoExtensions.pem diff --git a/testlint/testCerts/certVersion2WithExtension.pem b/testdata/certVersion2WithExtension.pem similarity index 100% rename from testlint/testCerts/certVersion2WithExtension.pem rename to testdata/certVersion2WithExtension.pem diff --git a/testlint/testCerts/certVersion3NoExtensions.pem b/testdata/certVersion3NoExtensions.pem similarity index 100% rename from testlint/testCerts/certVersion3NoExtensions.pem rename to testdata/certVersion3NoExtensions.pem diff --git a/testlint/testCerts/certVersion4NoExtensions.pem b/testdata/certVersion4NoExtensions.pem similarity index 100% rename from testlint/testCerts/certVersion4NoExtensions.pem rename to testdata/certVersion4NoExtensions.pem diff --git a/testlint/testCerts/certVersion4WithExtension.pem b/testdata/certVersion4WithExtension.pem similarity index 100% rename from testlint/testCerts/certVersion4WithExtension.pem rename to testdata/certVersion4WithExtension.pem diff --git a/testlint/testCerts/commonNameInSAN.pem b/testdata/commonNameInSAN.pem similarity index 100% rename from testlint/testCerts/commonNameInSAN.pem rename to testdata/commonNameInSAN.pem diff --git a/testlint/testCerts/commonNamesGood.pem b/testdata/commonNamesGood.pem similarity index 100% rename from testlint/testCerts/commonNamesGood.pem rename to testdata/commonNamesGood.pem diff --git a/testlint/testCerts/commonNamesIP.pem b/testdata/commonNamesIP.pem similarity index 100% rename from testlint/testCerts/commonNamesIP.pem rename to testdata/commonNamesIP.pem diff --git a/testlint/testCerts/commonNamesURL.pem b/testdata/commonNamesURL.pem similarity index 100% rename from testlint/testCerts/commonNamesURL.pem rename to testdata/commonNamesURL.pem diff --git a/testlint/testCerts/countryISOLowerCase.pem b/testdata/countryISOLowerCase.pem similarity index 100% rename from testlint/testCerts/countryISOLowerCase.pem rename to testdata/countryISOLowerCase.pem diff --git a/testlint/testCerts/crlComlepteDp.pem b/testdata/crlComlepteDp.pem similarity index 100% rename from testlint/testCerts/crlComlepteDp.pem rename to testdata/crlComlepteDp.pem diff --git a/testlint/testCerts/crlDistribCrit.pem b/testdata/crlDistribCrit.pem similarity index 100% rename from testlint/testCerts/crlDistribCrit.pem rename to testdata/crlDistribCrit.pem diff --git a/testlint/testCerts/crlDistribNoHTTP.pem b/testdata/crlDistribNoHTTP.pem similarity index 100% rename from testlint/testCerts/crlDistribNoHTTP.pem rename to testdata/crlDistribNoHTTP.pem diff --git a/testlint/testCerts/crlDistribNotCrit.pem b/testdata/crlDistribNotCrit.pem similarity index 100% rename from testlint/testCerts/crlDistribNotCrit.pem rename to testdata/crlDistribNotCrit.pem diff --git a/testlint/testCerts/crlDistribWithHTTP.pem b/testdata/crlDistribWithHTTP.pem similarity index 100% rename from testlint/testCerts/crlDistribWithHTTP.pem rename to testdata/crlDistribWithHTTP.pem diff --git a/testlint/testCerts/crlDistribWithLDAP.pem b/testdata/crlDistribWithLDAP.pem similarity index 100% rename from testlint/testCerts/crlDistribWithLDAP.pem rename to testdata/crlDistribWithLDAP.pem diff --git a/testlint/testCerts/crlIncomlepteDp.pem b/testdata/crlIncomlepteDp.pem similarity index 100% rename from testlint/testCerts/crlIncomlepteDp.pem rename to testdata/crlIncomlepteDp.pem diff --git a/testlint/testCerts/ct18mo2SCTs.pem b/testdata/ct18mo2SCTs.pem similarity index 100% rename from testlint/testCerts/ct18mo2SCTs.pem rename to testdata/ct18mo2SCTs.pem diff --git a/testlint/testCerts/ct18mo3SCTs.pem b/testdata/ct18mo3SCTs.pem similarity index 100% rename from testlint/testCerts/ct18mo3SCTs.pem rename to testdata/ct18mo3SCTs.pem diff --git a/testlint/testCerts/ct38mo3SCTs.pem b/testdata/ct38mo3SCTs.pem similarity index 100% rename from testlint/testCerts/ct38mo3SCTs.pem rename to testdata/ct38mo3SCTs.pem diff --git a/testlint/testCerts/ct38mo4SCTs.pem b/testdata/ct38mo4SCTs.pem similarity index 100% rename from testlint/testCerts/ct38mo4SCTs.pem rename to testdata/ct38mo4SCTs.pem diff --git a/testlint/testCerts/ct3mo1SCTs.pem b/testdata/ct3mo1SCTs.pem similarity index 100% rename from testlint/testCerts/ct3mo1SCTs.pem rename to testdata/ct3mo1SCTs.pem diff --git a/testlint/testCerts/ct3mo2DupeSCTs.pem b/testdata/ct3mo2DupeSCTs.pem similarity index 100% rename from testlint/testCerts/ct3mo2DupeSCTs.pem rename to testdata/ct3mo2DupeSCTs.pem diff --git a/testlint/testCerts/ct3mo2SCTs.pem b/testdata/ct3mo2SCTs.pem similarity index 100% rename from testlint/testCerts/ct3mo2SCTs.pem rename to testdata/ct3mo2SCTs.pem diff --git a/testlint/testCerts/ct666mo4SCTs.pem b/testdata/ct666mo4SCTs.pem similarity index 100% rename from testlint/testCerts/ct666mo4SCTs.pem rename to testdata/ct666mo4SCTs.pem diff --git a/testlint/testCerts/ct666mo5SCTs.pem b/testdata/ct666mo5SCTs.pem similarity index 100% rename from testlint/testCerts/ct666mo5SCTs.pem rename to testdata/ct666mo5SCTs.pem diff --git a/testlint/testCerts/ctNoSCTs.pem b/testdata/ctNoSCTs.pem similarity index 100% rename from testlint/testCerts/ctNoSCTs.pem rename to testdata/ctNoSCTs.pem diff --git a/testlint/testCerts/ctNoSCTsPoisoned.pem b/testdata/ctNoSCTsPoisoned.pem similarity index 100% rename from testlint/testCerts/ctNoSCTsPoisoned.pem rename to testdata/ctNoSCTsPoisoned.pem diff --git a/testlint/testCerts/directoryNamePresent.pem b/testdata/directoryNamePresent.pem similarity index 100% rename from testlint/testCerts/directoryNamePresent.pem rename to testdata/directoryNamePresent.pem diff --git a/testlint/testCerts/dnsNameBadCharacterInLabel.pem b/testdata/dnsNameBadCharacterInLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameBadCharacterInLabel.pem rename to testdata/dnsNameBadCharacterInLabel.pem diff --git a/testlint/testCerts/dnsNameClientCert.pem b/testdata/dnsNameClientCert.pem similarity index 100% rename from testlint/testCerts/dnsNameClientCert.pem rename to testdata/dnsNameClientCert.pem diff --git a/testlint/testCerts/dnsNameContainsBareIANASuffix.pem b/testdata/dnsNameContainsBareIANASuffix.pem similarity index 100% rename from testlint/testCerts/dnsNameContainsBareIANASuffix.pem rename to testdata/dnsNameContainsBareIANASuffix.pem diff --git a/testlint/testCerts/dnsNameContainsQuestionMark.pem b/testdata/dnsNameContainsQuestionMark.pem similarity index 100% rename from testlint/testCerts/dnsNameContainsQuestionMark.pem rename to testdata/dnsNameContainsQuestionMark.pem diff --git a/testlint/testCerts/dnsNameEmptyLabel.pem b/testdata/dnsNameEmptyLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameEmptyLabel.pem rename to testdata/dnsNameEmptyLabel.pem diff --git a/testlint/testCerts/dnsNameHyphenBeginningSLD.pem b/testdata/dnsNameHyphenBeginningSLD.pem similarity index 100% rename from testlint/testCerts/dnsNameHyphenBeginningSLD.pem rename to testdata/dnsNameHyphenBeginningSLD.pem diff --git a/testlint/testCerts/dnsNameHyphenEndingSLD.pem b/testdata/dnsNameHyphenEndingSLD.pem similarity index 100% rename from testlint/testCerts/dnsNameHyphenEndingSLD.pem rename to testdata/dnsNameHyphenEndingSLD.pem diff --git a/testlint/testCerts/dnsNameLabelTooLong.pem b/testdata/dnsNameLabelTooLong.pem similarity index 100% rename from testlint/testCerts/dnsNameLabelTooLong.pem rename to testdata/dnsNameLabelTooLong.pem diff --git a/testlint/testCerts/dnsNameNoEmptyLabel.pem b/testdata/dnsNameNoEmptyLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameNoEmptyLabel.pem rename to testdata/dnsNameNoEmptyLabel.pem diff --git a/testlint/testCerts/dnsNameNoLongerValidTLD.pem b/testdata/dnsNameNoLongerValidTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameNoLongerValidTLD.pem rename to testdata/dnsNameNoLongerValidTLD.pem diff --git a/testlint/testCerts/dnsNameNoUnderscoreInSLD.pem b/testdata/dnsNameNoUnderscoreInSLD.pem similarity index 100% rename from testlint/testCerts/dnsNameNoUnderscoreInSLD.pem rename to testdata/dnsNameNoUnderscoreInSLD.pem diff --git a/testlint/testCerts/dnsNameNoUnderscoreInTRD.pem b/testdata/dnsNameNoUnderscoreInTRD.pem similarity index 100% rename from testlint/testCerts/dnsNameNoUnderscoreInTRD.pem rename to testdata/dnsNameNoUnderscoreInTRD.pem diff --git a/testlint/testCerts/dnsNameNotEmptyLabel.pem b/testdata/dnsNameNotEmptyLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameNotEmptyLabel.pem rename to testdata/dnsNameNotEmptyLabel.pem diff --git a/testlint/testCerts/dnsNameNotValidTLD.pem b/testdata/dnsNameNotValidTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameNotValidTLD.pem rename to testdata/dnsNameNotValidTLD.pem diff --git a/testlint/testCerts/dnsNameNotYetValidTLD.pem b/testdata/dnsNameNotYetValidTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameNotYetValidTLD.pem rename to testdata/dnsNameNotYetValidTLD.pem diff --git a/testlint/testCerts/dnsNameOnionTLD.pem b/testdata/dnsNameOnionTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameOnionTLD.pem rename to testdata/dnsNameOnionTLD.pem diff --git a/testlint/testCerts/dnsNamePrivatePublicSuffix.pem b/testdata/dnsNamePrivatePublicSuffix.pem similarity index 100% rename from testlint/testCerts/dnsNamePrivatePublicSuffix.pem rename to testdata/dnsNamePrivatePublicSuffix.pem diff --git a/testlint/testCerts/dnsNameUnderscoreInSLD.pem b/testdata/dnsNameUnderscoreInSLD.pem similarity index 100% rename from testlint/testCerts/dnsNameUnderscoreInSLD.pem rename to testdata/dnsNameUnderscoreInSLD.pem diff --git a/testlint/testCerts/dnsNameUnderscoreInTRD.pem b/testdata/dnsNameUnderscoreInTRD.pem similarity index 100% rename from testlint/testCerts/dnsNameUnderscoreInTRD.pem rename to testdata/dnsNameUnderscoreInTRD.pem diff --git a/testlint/testCerts/dnsNameValidTLD.pem b/testdata/dnsNameValidTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameValidTLD.pem rename to testdata/dnsNameValidTLD.pem diff --git a/testlint/testCerts/dnsNameWasValidTLD.pem b/testdata/dnsNameWasValidTLD.pem similarity index 100% rename from testlint/testCerts/dnsNameWasValidTLD.pem rename to testdata/dnsNameWasValidTLD.pem diff --git a/testlint/testCerts/dnsNameWildcardCorrect.pem b/testdata/dnsNameWildcardCorrect.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardCorrect.pem rename to testdata/dnsNameWildcardCorrect.pem diff --git a/testlint/testCerts/dnsNameWildcardIncorrect.pem b/testdata/dnsNameWildcardIncorrect.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardIncorrect.pem rename to testdata/dnsNameWildcardIncorrect.pem diff --git a/testlint/testCerts/dnsNameWildcardLeftOfPublicSuffix.pem b/testdata/dnsNameWildcardLeftOfPublicSuffix.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardLeftOfPublicSuffix.pem rename to testdata/dnsNameWildcardLeftOfPublicSuffix.pem diff --git a/testlint/testCerts/dnsNameWildcardNotLeftOfPublicSuffix.pem b/testdata/dnsNameWildcardNotLeftOfPublicSuffix.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardNotLeftOfPublicSuffix.pem rename to testdata/dnsNameWildcardNotLeftOfPublicSuffix.pem diff --git a/testlint/testCerts/dnsNameWildcardNotOnlyInLeftLabel.pem b/testdata/dnsNameWildcardNotOnlyInLeftLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardNotOnlyInLeftLabel.pem rename to testdata/dnsNameWildcardNotOnlyInLeftLabel.pem diff --git a/testlint/testCerts/dnsNameWildcardOnlyInLeftLabel.pem b/testdata/dnsNameWildcardOnlyInLeftLabel.pem similarity index 100% rename from testlint/testCerts/dnsNameWildcardOnlyInLeftLabel.pem rename to testdata/dnsNameWildcardOnlyInLeftLabel.pem diff --git a/testlint/testCerts/dnsNameWithIPInCN.pem b/testdata/dnsNameWithIPInCN.pem similarity index 100% rename from testlint/testCerts/dnsNameWithIPInCN.pem rename to testdata/dnsNameWithIPInCN.pem diff --git a/testlint/testCerts/dnsNamesNFC.pem b/testdata/dnsNamesNFC.pem similarity index 100% rename from testlint/testCerts/dnsNamesNFC.pem rename to testdata/dnsNamesNFC.pem diff --git a/testlint/testCerts/dnsNamesNFKC.pem b/testdata/dnsNamesNFKC.pem similarity index 100% rename from testlint/testCerts/dnsNamesNFKC.pem rename to testdata/dnsNamesNFKC.pem diff --git a/testlint/testCerts/dnsNamesNotNFC.pem b/testdata/dnsNamesNotNFC.pem similarity index 100% rename from testlint/testCerts/dnsNamesNotNFC.pem rename to testdata/dnsNamesNotNFC.pem diff --git a/testlint/testCerts/dnsNamesNotNFKC.pem b/testdata/dnsNamesNotNFKC.pem similarity index 100% rename from testlint/testCerts/dnsNamesNotNFKC.pem rename to testdata/dnsNamesNotNFKC.pem diff --git a/testlint/testCerts/domainValAllBad.pem b/testdata/domainValAllBad.pem similarity index 100% rename from testlint/testCerts/domainValAllBad.pem rename to testdata/domainValAllBad.pem diff --git a/testlint/testCerts/domainValGoodSubject.pem b/testdata/domainValGoodSubject.pem similarity index 100% rename from testlint/testCerts/domainValGoodSubject.pem rename to testdata/domainValGoodSubject.pem diff --git a/testlint/testCerts/domainValSubCaGood.pem b/testdata/domainValSubCaGood.pem similarity index 100% rename from testlint/testCerts/domainValSubCaGood.pem rename to testdata/domainValSubCaGood.pem diff --git a/testlint/testCerts/domainValWithLocal.pem b/testdata/domainValWithLocal.pem similarity index 100% rename from testlint/testCerts/domainValWithLocal.pem rename to testdata/domainValWithLocal.pem diff --git a/testlint/testCerts/domainValWithOrg.pem b/testdata/domainValWithOrg.pem similarity index 100% rename from testlint/testCerts/domainValWithOrg.pem rename to testdata/domainValWithOrg.pem diff --git a/testlint/testCerts/domainValWithPostal.pem b/testdata/domainValWithPostal.pem similarity index 100% rename from testlint/testCerts/domainValWithPostal.pem rename to testdata/domainValWithPostal.pem diff --git a/testlint/testCerts/domainValWithProvince.pem b/testdata/domainValWithProvince.pem similarity index 100% rename from testlint/testCerts/domainValWithProvince.pem rename to testdata/domainValWithProvince.pem diff --git a/testlint/testCerts/domainValWithStreet.pem b/testdata/domainValWithStreet.pem similarity index 100% rename from testlint/testCerts/domainValWithStreet.pem rename to testdata/domainValWithStreet.pem diff --git a/testlint/testCerts/dsaBadQLen.pem b/testdata/dsaBadQLen.pem similarity index 100% rename from testlint/testCerts/dsaBadQLen.pem rename to testdata/dsaBadQLen.pem diff --git a/testlint/testCerts/dsaCorrectOrderInSubgroup.pem b/testdata/dsaCorrectOrderInSubgroup.pem similarity index 100% rename from testlint/testCerts/dsaCorrectOrderInSubgroup.pem rename to testdata/dsaCorrectOrderInSubgroup.pem diff --git a/testlint/testCerts/dsaNotShorterThan2048Bits.pem b/testdata/dsaNotShorterThan2048Bits.pem similarity index 100% rename from testlint/testCerts/dsaNotShorterThan2048Bits.pem rename to testdata/dsaNotShorterThan2048Bits.pem diff --git a/testlint/testCerts/dsaShorterThan2048Bits.pem b/testdata/dsaShorterThan2048Bits.pem similarity index 100% rename from testlint/testCerts/dsaShorterThan2048Bits.pem rename to testdata/dsaShorterThan2048Bits.pem diff --git a/testlint/testCerts/dsaUniqueRep.pem b/testdata/dsaUniqueRep.pem similarity index 100% rename from testlint/testCerts/dsaUniqueRep.pem rename to testdata/dsaUniqueRep.pem diff --git a/testlint/testCerts/ecdsaP224.pem b/testdata/ecdsaP224.pem similarity index 100% rename from testlint/testCerts/ecdsaP224.pem rename to testdata/ecdsaP224.pem diff --git a/testlint/testCerts/ecdsaP256.pem b/testdata/ecdsaP256.pem similarity index 100% rename from testlint/testCerts/ecdsaP256.pem rename to testdata/ecdsaP256.pem diff --git a/testlint/testCerts/ecdsaP256ValidKUs.pem b/testdata/ecdsaP256ValidKUs.pem similarity index 100% rename from testlint/testCerts/ecdsaP256ValidKUs.pem rename to testdata/ecdsaP256ValidKUs.pem diff --git a/testlint/testCerts/ecdsaP384.pem b/testdata/ecdsaP384.pem similarity index 100% rename from testlint/testCerts/ecdsaP384.pem rename to testdata/ecdsaP384.pem diff --git a/testlint/testCerts/ecdsaP384InvalidKUs.pem b/testdata/ecdsaP384InvalidKUs.pem similarity index 100% rename from testlint/testCerts/ecdsaP384InvalidKUs.pem rename to testdata/ecdsaP384InvalidKUs.pem diff --git a/testlint/testCerts/ecdsaP521.pem b/testdata/ecdsaP521.pem similarity index 100% rename from testlint/testCerts/ecdsaP521.pem rename to testdata/ecdsaP521.pem diff --git a/testlint/testCerts/ekuAnyCrit.pem b/testdata/ekuAnyCrit.pem similarity index 100% rename from testlint/testCerts/ekuAnyCrit.pem rename to testdata/ekuAnyCrit.pem diff --git a/testlint/testCerts/ekuAnyNoCrit.pem b/testdata/ekuAnyNoCrit.pem similarity index 100% rename from testlint/testCerts/ekuAnyNoCrit.pem rename to testdata/ekuAnyNoCrit.pem diff --git a/testlint/testCerts/ekuNoAnyCrit.pem b/testdata/ekuNoAnyCrit.pem similarity index 100% rename from testlint/testCerts/ekuNoAnyCrit.pem rename to testdata/ekuNoAnyCrit.pem diff --git a/testlint/testCerts/emptyPermittedDNSBadExcludedDNS.pem b/testdata/emptyPermittedDNSBadExcludedDNS.pem similarity index 100% rename from testlint/testCerts/emptyPermittedDNSBadExcludedDNS.pem rename to testdata/emptyPermittedDNSBadExcludedDNS.pem diff --git a/testlint/testCerts/emptyPermittedDNSGoodExcludedDNS.pem b/testdata/emptyPermittedDNSGoodExcludedDNS.pem similarity index 100% rename from testlint/testCerts/emptyPermittedDNSGoodExcludedDNS.pem rename to testdata/emptyPermittedDNSGoodExcludedDNS.pem diff --git a/testlint/testCerts/emptyPermittedIPExcludedBoth.pem b/testdata/emptyPermittedIPExcludedBoth.pem similarity index 100% rename from testlint/testCerts/emptyPermittedIPExcludedBoth.pem rename to testdata/emptyPermittedIPExcludedBoth.pem diff --git a/testlint/testCerts/emptyPermittedIPExcludedIPv4.pem b/testdata/emptyPermittedIPExcludedIPv4.pem similarity index 100% rename from testlint/testCerts/emptyPermittedIPExcludedIPv4.pem rename to testdata/emptyPermittedIPExcludedIPv4.pem diff --git a/testlint/testCerts/emptyPermittedIPExcludedIPv6.pem b/testdata/emptyPermittedIPExcludedIPv6.pem similarity index 100% rename from testlint/testCerts/emptyPermittedIPExcludedIPv6.pem rename to testdata/emptyPermittedIPExcludedIPv6.pem diff --git a/testlint/testCerts/evAllGood.pem b/testdata/evAllGood.pem similarity index 100% rename from testlint/testCerts/evAllGood.pem rename to testdata/evAllGood.pem diff --git a/testlint/testCerts/evNoCountry.pem b/testdata/evNoCountry.pem similarity index 100% rename from testlint/testCerts/evNoCountry.pem rename to testdata/evNoCountry.pem diff --git a/testlint/testCerts/evNoLocal.pem b/testdata/evNoLocal.pem similarity index 100% rename from testlint/testCerts/evNoLocal.pem rename to testdata/evNoLocal.pem diff --git a/testlint/testCerts/evNoOrg.pem b/testdata/evNoOrg.pem similarity index 100% rename from testlint/testCerts/evNoOrg.pem rename to testdata/evNoOrg.pem diff --git a/testlint/testCerts/evNoSN.pem b/testdata/evNoSN.pem similarity index 100% rename from testlint/testCerts/evNoSN.pem rename to testdata/evNoSN.pem diff --git a/testlint/testCerts/evValidNotTooLong.pem b/testdata/evValidNotTooLong.pem similarity index 100% rename from testlint/testCerts/evValidNotTooLong.pem rename to testdata/evValidNotTooLong.pem diff --git a/testlint/testCerts/evValidTooLong.pem b/testdata/evValidTooLong.pem similarity index 100% rename from testlint/testCerts/evValidTooLong.pem rename to testdata/evValidTooLong.pem diff --git a/testlint/testCerts/evenRsaMod.pem b/testdata/evenRsaMod.pem similarity index 100% rename from testlint/testCerts/evenRsaMod.pem rename to testdata/evenRsaMod.pem diff --git a/testlint/testCerts/explicitText200Char.pem b/testdata/explicitText200Char.pem similarity index 100% rename from testlint/testCerts/explicitText200Char.pem rename to testdata/explicitText200Char.pem diff --git a/testlint/testCerts/explicitTextBMPNFC.pem b/testdata/explicitTextBMPNFC.pem similarity index 100% rename from testlint/testCerts/explicitTextBMPNFC.pem rename to testdata/explicitTextBMPNFC.pem diff --git a/testlint/testCerts/explicitTextBMPNotNFC.pem b/testdata/explicitTextBMPNotNFC.pem similarity index 100% rename from testlint/testCerts/explicitTextBMPNotNFC.pem rename to testdata/explicitTextBMPNotNFC.pem diff --git a/testlint/testCerts/explicitTextBMPString.pem b/testdata/explicitTextBMPString.pem similarity index 100% rename from testlint/testCerts/explicitTextBMPString.pem rename to testdata/explicitTextBMPString.pem diff --git a/testlint/testCerts/explicitTextNotNFC.pem b/testdata/explicitTextNotNFC.pem similarity index 100% rename from testlint/testCerts/explicitTextNotNFC.pem rename to testdata/explicitTextNotNFC.pem diff --git a/testlint/testCerts/explicitTextUtf8NotNFC.pem b/testdata/explicitTextUtf8NotNFC.pem similarity index 100% rename from testlint/testCerts/explicitTextUtf8NotNFC.pem rename to testdata/explicitTextUtf8NotNFC.pem diff --git a/testlint/testCerts/extSANDuplicated.pem b/testdata/extSANDuplicated.pem similarity index 100% rename from testlint/testCerts/extSANDuplicated.pem rename to testdata/extSANDuplicated.pem diff --git a/testlint/testCerts/extSkiDuplicatedShortlist.pem b/testdata/extSkiDuplicatedShortlist.pem similarity index 100% rename from testlint/testCerts/extSkiDuplicatedShortlist.pem rename to testdata/extSkiDuplicatedShortlist.pem diff --git a/testlint/testCerts/extUnknownDuplicated.pem b/testdata/extUnknownDuplicated.pem similarity index 100% rename from testlint/testCerts/extUnknownDuplicated.pem rename to testdata/extUnknownDuplicated.pem diff --git a/testlint/testCerts/extUnknownDuplicatedCritical.pem b/testdata/extUnknownDuplicatedCritical.pem similarity index 100% rename from testlint/testCerts/extUnknownDuplicatedCritical.pem rename to testdata/extUnknownDuplicatedCritical.pem diff --git a/testlint/testCerts/extraCommonNames.pem b/testdata/extraCommonNames.pem similarity index 100% rename from testlint/testCerts/extraCommonNames.pem rename to testdata/extraCommonNames.pem diff --git a/testlint/testCerts/frshCRLCritical.pem b/testdata/frshCRLCritical.pem similarity index 100% rename from testlint/testCerts/frshCRLCritical.pem rename to testdata/frshCRLCritical.pem diff --git a/testlint/testCerts/frshCRLNotCritical.pem b/testdata/frshCRLNotCritical.pem similarity index 100% rename from testlint/testCerts/frshCRLNotCritical.pem rename to testdata/frshCRLNotCritical.pem diff --git a/testlint/testCerts/generalizedAfter2050.pem b/testdata/generalizedAfter2050.pem similarity index 100% rename from testlint/testCerts/generalizedAfter2050.pem rename to testdata/generalizedAfter2050.pem diff --git a/testlint/testCerts/generalizedHasSeconds.pem b/testdata/generalizedHasSeconds.pem similarity index 100% rename from testlint/testCerts/generalizedHasSeconds.pem rename to testdata/generalizedHasSeconds.pem diff --git a/testlint/testCerts/generalizedNoFraction.pem b/testdata/generalizedNoFraction.pem similarity index 100% rename from testlint/testCerts/generalizedNoFraction.pem rename to testdata/generalizedNoFraction.pem diff --git a/testlint/testCerts/generalizedNoSeconds.pem b/testdata/generalizedNoSeconds.pem similarity index 100% rename from testlint/testCerts/generalizedNoSeconds.pem rename to testdata/generalizedNoSeconds.pem diff --git a/testlint/testCerts/generalizedNotZulu.pem b/testdata/generalizedNotZulu.pem similarity index 100% rename from testlint/testCerts/generalizedNotZulu.pem rename to testdata/generalizedNotZulu.pem diff --git a/testlint/testCerts/generalizedPrior2050.pem b/testdata/generalizedPrior2050.pem similarity index 100% rename from testlint/testCerts/generalizedPrior2050.pem rename to testdata/generalizedPrior2050.pem diff --git a/testlint/testCerts/generalizedTimeBefore2050.pem b/testdata/generalizedTimeBefore2050.pem similarity index 100% rename from testlint/testCerts/generalizedTimeBefore2050.pem rename to testdata/generalizedTimeBefore2050.pem diff --git a/testlint/testCerts/generalizedTimeNoSeconds.pem b/testdata/generalizedTimeNoSeconds.pem similarity index 100% rename from testlint/testCerts/generalizedTimeNoSeconds.pem rename to testdata/generalizedTimeNoSeconds.pem diff --git a/testlint/testCerts/givenNameCorrectPolicy.pem b/testdata/givenNameCorrectPolicy.pem similarity index 100% rename from testlint/testCerts/givenNameCorrectPolicy.pem rename to testdata/givenNameCorrectPolicy.pem diff --git a/testlint/testCerts/givenNameIncorrectPolicy.pem b/testdata/givenNameIncorrectPolicy.pem similarity index 100% rename from testlint/testCerts/givenNameIncorrectPolicy.pem rename to testdata/givenNameIncorrectPolicy.pem diff --git a/testlint/testCerts/goodRsaExp.pem b/testdata/goodRsaExp.pem similarity index 100% rename from testlint/testCerts/goodRsaExp.pem rename to testdata/goodRsaExp.pem diff --git a/testlint/testCerts/goodRsaExpLength.pem b/testdata/goodRsaExpLength.pem similarity index 100% rename from testlint/testCerts/goodRsaExpLength.pem rename to testdata/goodRsaExpLength.pem diff --git a/testlint/testCerts/gtldcnbad.pem b/testdata/gtldcnbad.pem similarity index 100% rename from testlint/testCerts/gtldcnbad.pem rename to testdata/gtldcnbad.pem diff --git a/testlint/testCerts/gtldcnip.pem b/testdata/gtldcnip.pem similarity index 100% rename from testlint/testCerts/gtldcnip.pem rename to testdata/gtldcnip.pem diff --git a/testlint/testCerts/gtldcnnotdn.pem b/testdata/gtldcnnotdn.pem similarity index 100% rename from testlint/testCerts/gtldcnnotdn.pem rename to testdata/gtldcnnotdn.pem diff --git a/testlint/testCerts/gtldcnvalid.pem b/testdata/gtldcnvalid.pem similarity index 100% rename from testlint/testCerts/gtldcnvalid.pem rename to testdata/gtldcnvalid.pem diff --git a/testlint/testCerts/gtlddnsbad.pem b/testdata/gtlddnsbad.pem similarity index 100% rename from testlint/testCerts/gtlddnsbad.pem rename to testdata/gtlddnsbad.pem diff --git a/testlint/testCerts/gtlddnsip.pem b/testdata/gtlddnsip.pem similarity index 100% rename from testlint/testCerts/gtlddnsip.pem rename to testdata/gtlddnsip.pem diff --git a/testlint/testCerts/gtlddnsnotdn.pem b/testdata/gtlddnsnotdn.pem similarity index 100% rename from testlint/testCerts/gtlddnsnotdn.pem rename to testdata/gtlddnsnotdn.pem diff --git a/testlint/testCerts/gtlddnsvalid.pem b/testdata/gtlddnsvalid.pem similarity index 100% rename from testlint/testCerts/gtlddnsvalid.pem rename to testdata/gtlddnsvalid.pem diff --git a/testlint/testCerts/idnCorrectUnicode.pem b/testdata/idnCorrectUnicode.pem similarity index 100% rename from testlint/testCerts/idnCorrectUnicode.pem rename to testdata/idnCorrectUnicode.pem diff --git a/testlint/testCerts/idnMalformedUnicode.pem b/testdata/idnMalformedUnicode.pem similarity index 100% rename from testlint/testCerts/idnMalformedUnicode.pem rename to testdata/idnMalformedUnicode.pem diff --git a/testlint/testCerts/illegalChar.pem b/testdata/illegalChar.pem similarity index 100% rename from testlint/testCerts/illegalChar.pem rename to testdata/illegalChar.pem diff --git a/testlint/testCerts/indivValAllBad.pem b/testdata/indivValAllBad.pem similarity index 100% rename from testlint/testCerts/indivValAllBad.pem rename to testdata/indivValAllBad.pem diff --git a/testlint/testCerts/indivValGivenNameOnly.pem b/testdata/indivValGivenNameOnly.pem similarity index 100% rename from testlint/testCerts/indivValGivenNameOnly.pem rename to testdata/indivValGivenNameOnly.pem diff --git a/testlint/testCerts/indivValGoodAllFields.pem b/testdata/indivValGoodAllFields.pem similarity index 100% rename from testlint/testCerts/indivValGoodAllFields.pem rename to testdata/indivValGoodAllFields.pem diff --git a/testlint/testCerts/indivValGoodLocalNoProvince.pem b/testdata/indivValGoodLocalNoProvince.pem similarity index 100% rename from testlint/testCerts/indivValGoodLocalNoProvince.pem rename to testdata/indivValGoodLocalNoProvince.pem diff --git a/testlint/testCerts/indivValGoodNoOrg.pem b/testdata/indivValGoodNoOrg.pem similarity index 100% rename from testlint/testCerts/indivValGoodNoOrg.pem rename to testdata/indivValGoodNoOrg.pem diff --git a/testlint/testCerts/indivValGoodOrgOnly.pem b/testdata/indivValGoodOrgOnly.pem similarity index 100% rename from testlint/testCerts/indivValGoodOrgOnly.pem rename to testdata/indivValGoodOrgOnly.pem diff --git a/testlint/testCerts/indivValGoodProvinceNoLocal.pem b/testdata/indivValGoodProvinceNoLocal.pem similarity index 100% rename from testlint/testCerts/indivValGoodProvinceNoLocal.pem rename to testdata/indivValGoodProvinceNoLocal.pem diff --git a/testlint/testCerts/indivValNoCountry.pem b/testdata/indivValNoCountry.pem similarity index 100% rename from testlint/testCerts/indivValNoCountry.pem rename to testdata/indivValNoCountry.pem diff --git a/testlint/testCerts/indivValNoLocalOrProvince.pem b/testdata/indivValNoLocalOrProvince.pem similarity index 100% rename from testlint/testCerts/indivValNoLocalOrProvince.pem rename to testdata/indivValNoLocalOrProvince.pem diff --git a/testlint/testCerts/indivValNoOrgOrPersonalNames.pem b/testdata/indivValNoOrgOrPersonalNames.pem similarity index 100% rename from testlint/testCerts/indivValNoOrgOrPersonalNames.pem rename to testdata/indivValNoOrgOrPersonalNames.pem diff --git a/testlint/testCerts/indivValSurnameOnly.pem b/testdata/indivValSurnameOnly.pem similarity index 100% rename from testlint/testCerts/indivValSurnameOnly.pem rename to testdata/indivValSurnameOnly.pem diff --git a/testlint/testCerts/inhibitAnyCrit.pem b/testdata/inhibitAnyCrit.pem similarity index 100% rename from testlint/testCerts/inhibitAnyCrit.pem rename to testdata/inhibitAnyCrit.pem diff --git a/testlint/testCerts/inhibitAnyNotCrit.pem b/testdata/inhibitAnyNotCrit.pem similarity index 100% rename from testlint/testCerts/inhibitAnyNotCrit.pem rename to testdata/inhibitAnyNotCrit.pem diff --git a/testlint/testCerts/issuerDNLeadingSpace.pem b/testdata/issuerDNLeadingSpace.pem similarity index 100% rename from testlint/testCerts/issuerDNLeadingSpace.pem rename to testdata/issuerDNLeadingSpace.pem diff --git a/testlint/testCerts/issuerDNTrailingSpace.pem b/testdata/issuerDNTrailingSpace.pem similarity index 100% rename from testlint/testCerts/issuerDNTrailingSpace.pem rename to testdata/issuerDNTrailingSpace.pem diff --git a/testlint/testCerts/issuerFieldFilled.pem b/testdata/issuerFieldFilled.pem similarity index 100% rename from testlint/testCerts/issuerFieldFilled.pem rename to testdata/issuerFieldFilled.pem diff --git a/testlint/testCerts/issuerFieldMissing.pem b/testdata/issuerFieldMissing.pem similarity index 100% rename from testlint/testCerts/issuerFieldMissing.pem rename to testdata/issuerFieldMissing.pem diff --git a/testlint/testCerts/issuerRDNTwoAttribute.pem b/testdata/issuerRDNTwoAttribute.pem similarity index 100% rename from testlint/testCerts/issuerRDNTwoAttribute.pem rename to testdata/issuerRDNTwoAttribute.pem diff --git a/testlint/testCerts/issuerUID.pem b/testdata/issuerUID.pem similarity index 100% rename from testlint/testCerts/issuerUID.pem rename to testdata/issuerUID.pem diff --git a/testlint/testCerts/keyCertSignCA.pem b/testdata/keyCertSignCA.pem similarity index 100% rename from testlint/testCerts/keyCertSignCA.pem rename to testdata/keyCertSignCA.pem diff --git a/testlint/testCerts/keyCertSignNotCA.pem b/testdata/keyCertSignNotCA.pem similarity index 100% rename from testlint/testCerts/keyCertSignNotCA.pem rename to testdata/keyCertSignNotCA.pem diff --git a/testlint/testCerts/keyUsageCertSignEndEntity.pem b/testdata/keyUsageCertSignEndEntity.pem similarity index 100% rename from testlint/testCerts/keyUsageCertSignEndEntity.pem rename to testdata/keyUsageCertSignEndEntity.pem diff --git a/testlint/testCerts/keyUsageCertSignNoBC.pem b/testdata/keyUsageCertSignNoBC.pem similarity index 100% rename from testlint/testCerts/keyUsageCertSignNoBC.pem rename to testdata/keyUsageCertSignNoBC.pem diff --git a/testlint/testCerts/keyUsageNoBits.pem b/testdata/keyUsageNoBits.pem similarity index 100% rename from testlint/testCerts/keyUsageNoBits.pem rename to testdata/keyUsageNoBits.pem diff --git a/testlint/testCerts/keyUsageNotCriticalSubCert.pem b/testdata/keyUsageNotCriticalSubCert.pem similarity index 100% rename from testlint/testCerts/keyUsageNotCriticalSubCert.pem rename to testdata/keyUsageNotCriticalSubCert.pem diff --git a/testlint/testCerts/legalChar.pem b/testdata/legalChar.pem similarity index 100% rename from testlint/testCerts/legalChar.pem rename to testdata/legalChar.pem diff --git a/testlint/testCerts/localNoOrg.pem b/testdata/localNoOrg.pem similarity index 100% rename from testlint/testCerts/localNoOrg.pem rename to testdata/localNoOrg.pem diff --git a/testlint/testCerts/localYesOrg.pem b/testdata/localYesOrg.pem similarity index 100% rename from testlint/testCerts/localYesOrg.pem rename to testdata/localYesOrg.pem diff --git a/testlint/testCerts/md5WithRSASignatureAlgorithm.pem b/testdata/md5WithRSASignatureAlgorithm.pem similarity index 100% rename from testlint/testCerts/md5WithRSASignatureAlgorithm.pem rename to testdata/md5WithRSASignatureAlgorithm.pem diff --git a/testlint/testCerts/mpAuthorityKeyIdentifierCorrect.pem b/testdata/mpAuthorityKeyIdentifierCorrect.pem similarity index 100% rename from testlint/testCerts/mpAuthorityKeyIdentifierCorrect.pem rename to testdata/mpAuthorityKeyIdentifierCorrect.pem diff --git a/testlint/testCerts/mpAuthorityKeyIdentifierIncorrect.pem b/testdata/mpAuthorityKeyIdentifierIncorrect.pem similarity index 100% rename from testlint/testCerts/mpAuthorityKeyIdentifierIncorrect.pem rename to testdata/mpAuthorityKeyIdentifierIncorrect.pem diff --git a/testlint/testCerts/mpCrossCertNoEKU.pem b/testdata/mpCrossCertNoEKU.pem similarity index 100% rename from testlint/testCerts/mpCrossCertNoEKU.pem rename to testdata/mpCrossCertNoEKU.pem diff --git a/testlint/testCerts/mpExponent1.pem b/testdata/mpExponent1.pem similarity index 100% rename from testlint/testCerts/mpExponent1.pem rename to testdata/mpExponent1.pem diff --git a/testlint/testCerts/mpExponent10001.pem b/testdata/mpExponent10001.pem similarity index 100% rename from testlint/testCerts/mpExponent10001.pem rename to testdata/mpExponent10001.pem diff --git a/testlint/testCerts/mpModulus1024.pem b/testdata/mpModulus1024.pem similarity index 100% rename from testlint/testCerts/mpModulus1024.pem rename to testdata/mpModulus1024.pem diff --git a/testlint/testCerts/mpModulus2048.pem b/testdata/mpModulus2048.pem similarity index 100% rename from testlint/testCerts/mpModulus2048.pem rename to testdata/mpModulus2048.pem diff --git a/testlint/testCerts/mpModulus4095.pem b/testdata/mpModulus4095.pem similarity index 100% rename from testlint/testCerts/mpModulus4095.pem rename to testdata/mpModulus4095.pem diff --git a/testlint/testCerts/mpSubCAEKUAllowed.pem b/testdata/mpSubCAEKUAllowed.pem similarity index 100% rename from testlint/testCerts/mpSubCAEKUAllowed.pem rename to testdata/mpSubCAEKUAllowed.pem diff --git a/testlint/testCerts/mpSubCAEKUDisallowed1.pem b/testdata/mpSubCAEKUDisallowed1.pem similarity index 100% rename from testlint/testCerts/mpSubCAEKUDisallowed1.pem rename to testdata/mpSubCAEKUDisallowed1.pem diff --git a/testlint/testCerts/mpSubCAEKUDisallowed2.pem b/testdata/mpSubCAEKUDisallowed2.pem similarity index 100% rename from testlint/testCerts/mpSubCAEKUDisallowed2.pem rename to testdata/mpSubCAEKUDisallowed2.pem diff --git a/testlint/testCerts/mpSubCAEKUDisallowed3.pem b/testdata/mpSubCAEKUDisallowed3.pem similarity index 100% rename from testlint/testCerts/mpSubCAEKUDisallowed3.pem rename to testdata/mpSubCAEKUDisallowed3.pem diff --git a/testlint/testCerts/nameConstraintsMissing.pem b/testdata/nameConstraintsMissing.pem similarity index 100% rename from testlint/testCerts/nameConstraintsMissing.pem rename to testdata/nameConstraintsMissing.pem diff --git a/testlint/testCerts/ncAllPres.pem b/testdata/ncAllPres.pem similarity index 100% rename from testlint/testCerts/ncAllPres.pem rename to testdata/ncAllPres.pem diff --git a/testlint/testCerts/ncEmptyValue.pem b/testdata/ncEmptyValue.pem similarity index 100% rename from testlint/testCerts/ncEmptyValue.pem rename to testdata/ncEmptyValue.pem diff --git a/testlint/testCerts/ncMinPres.pem b/testdata/ncMinPres.pem similarity index 100% rename from testlint/testCerts/ncMinPres.pem rename to testdata/ncMinPres.pem diff --git a/testlint/testCerts/ncMinZero.pem b/testdata/ncMinZero.pem similarity index 100% rename from testlint/testCerts/ncMinZero.pem rename to testdata/ncMinZero.pem diff --git a/testlint/testCerts/ncOnEDI.pem b/testdata/ncOnEDI.pem similarity index 100% rename from testlint/testCerts/ncOnEDI.pem rename to testdata/ncOnEDI.pem diff --git a/testlint/testCerts/ncOnRegId.pem b/testdata/ncOnRegId.pem similarity index 100% rename from testlint/testCerts/ncOnRegId.pem rename to testdata/ncOnRegId.pem diff --git a/testlint/testCerts/ncOnX400.pem b/testdata/ncOnX400.pem similarity index 100% rename from testlint/testCerts/ncOnX400.pem rename to testdata/ncOnX400.pem diff --git a/testlint/testCerts/noAia.pem b/testdata/noAia.pem similarity index 100% rename from testlint/testCerts/noAia.pem rename to testdata/noAia.pem diff --git a/testlint/testCerts/noNameConstraint.pem b/testdata/noNameConstraint.pem similarity index 100% rename from testlint/testCerts/noNameConstraint.pem rename to testdata/noNameConstraint.pem diff --git a/testlint/testCerts/noPubExpRange.pem b/testdata/noPubExpRange.pem similarity index 100% rename from testlint/testCerts/noPubExpRange.pem rename to testdata/noPubExpRange.pem diff --git a/testlint/testCerts/noRsaLength.pem b/testdata/noRsaLength.pem similarity index 100% rename from testlint/testCerts/noRsaLength.pem rename to testdata/noRsaLength.pem diff --git a/testlint/testCerts/nonEmptyPermitted.pem b/testdata/nonEmptyPermitted.pem similarity index 100% rename from testlint/testCerts/nonEmptyPermitted.pem rename to testdata/nonEmptyPermitted.pem diff --git a/testlint/testCerts/nonEmptyPermittedDNS.pem b/testdata/nonEmptyPermittedDNS.pem similarity index 100% rename from testlint/testCerts/nonEmptyPermittedDNS.pem rename to testdata/nonEmptyPermittedDNS.pem diff --git a/testlint/testCerts/notDN.pem b/testdata/notDN.pem similarity index 100% rename from testlint/testCerts/notDN.pem rename to testdata/notDN.pem diff --git a/testlint/testCerts/oddRsaMod.pem b/testdata/oddRsaMod.pem similarity index 100% rename from testlint/testCerts/oddRsaMod.pem rename to testdata/oddRsaMod.pem diff --git a/testlint/testCerts/oldRootModSmall.pem b/testdata/oldRootModSmall.pem similarity index 100% rename from testlint/testCerts/oldRootModSmall.pem rename to testdata/oldRootModSmall.pem diff --git a/testlint/testCerts/oldRootModTooSmall.pem b/testdata/oldRootModTooSmall.pem similarity index 100% rename from testlint/testCerts/oldRootModTooSmall.pem rename to testdata/oldRootModTooSmall.pem diff --git a/testlint/testCerts/oldSubModSmall.pem b/testdata/oldSubModSmall.pem similarity index 100% rename from testlint/testCerts/oldSubModSmall.pem rename to testdata/oldSubModSmall.pem diff --git a/testlint/testCerts/oldSubModTooSmall.pem b/testdata/oldSubModTooSmall.pem similarity index 100% rename from testlint/testCerts/oldSubModTooSmall.pem rename to testdata/oldSubModTooSmall.pem diff --git a/testlint/testCerts/oldSubSmall.pem b/testdata/oldSubSmall.pem similarity index 100% rename from testlint/testCerts/oldSubSmall.pem rename to testdata/oldSubSmall.pem diff --git a/testlint/testCerts/oldSubTooSmall.pem b/testdata/oldSubTooSmall.pem similarity index 100% rename from testlint/testCerts/oldSubTooSmall.pem rename to testdata/oldSubTooSmall.pem diff --git a/testlint/testCerts/onionSANBadServDescHashMismatch.pem b/testdata/onionSANBadServDescHashMismatch.pem similarity index 100% rename from testlint/testCerts/onionSANBadServDescHashMismatch.pem rename to testdata/onionSANBadServDescHashMismatch.pem diff --git a/testlint/testCerts/onionSANBadServDescInvalidUTF8OnionURI.pem b/testdata/onionSANBadServDescInvalidUTF8OnionURI.pem similarity index 100% rename from testlint/testCerts/onionSANBadServDescInvalidUTF8OnionURI.pem rename to testdata/onionSANBadServDescInvalidUTF8OnionURI.pem diff --git a/testlint/testCerts/onionSANBadServDescUnknownHashAlg.pem b/testdata/onionSANBadServDescUnknownHashAlg.pem similarity index 100% rename from testlint/testCerts/onionSANBadServDescUnknownHashAlg.pem rename to testdata/onionSANBadServDescUnknownHashAlg.pem diff --git a/testlint/testCerts/onionSANEV.pem b/testdata/onionSANEV.pem similarity index 100% rename from testlint/testCerts/onionSANEV.pem rename to testdata/onionSANEV.pem diff --git a/testlint/testCerts/onionSANGoodExpiry.pem b/testdata/onionSANGoodExpiry.pem similarity index 100% rename from testlint/testCerts/onionSANGoodExpiry.pem rename to testdata/onionSANGoodExpiry.pem diff --git a/testlint/testCerts/onionSANGoodServDesc.pem b/testdata/onionSANGoodServDesc.pem similarity index 100% rename from testlint/testCerts/onionSANGoodServDesc.pem rename to testdata/onionSANGoodServDesc.pem diff --git a/testlint/testCerts/onionSANLongExpiry.pem b/testdata/onionSANLongExpiry.pem similarity index 100% rename from testlint/testCerts/onionSANLongExpiry.pem rename to testdata/onionSANLongExpiry.pem diff --git a/testlint/testCerts/onionSANLongExpiryPreBallot.pem b/testdata/onionSANLongExpiryPreBallot.pem similarity index 100% rename from testlint/testCerts/onionSANLongExpiryPreBallot.pem rename to testdata/onionSANLongExpiryPreBallot.pem diff --git a/testlint/testCerts/onionSANMissingServDescHash.pem b/testdata/onionSANMissingServDescHash.pem similarity index 100% rename from testlint/testCerts/onionSANMissingServDescHash.pem rename to testdata/onionSANMissingServDescHash.pem diff --git a/testlint/testCerts/onionSANNotEV.pem b/testdata/onionSANNotEV.pem similarity index 100% rename from testlint/testCerts/onionSANNotEV.pem rename to testdata/onionSANNotEV.pem diff --git a/testlint/testCerts/onionSANTooManyServDesc.pem b/testdata/onionSANTooManyServDesc.pem similarity index 100% rename from testlint/testCerts/onionSANTooManyServDesc.pem rename to testdata/onionSANTooManyServDesc.pem diff --git a/testlint/testCerts/orgNoBoth.pem b/testdata/orgNoBoth.pem similarity index 100% rename from testlint/testCerts/orgNoBoth.pem rename to testdata/orgNoBoth.pem diff --git a/testlint/testCerts/orgNoCountry.pem b/testdata/orgNoCountry.pem similarity index 100% rename from testlint/testCerts/orgNoCountry.pem rename to testdata/orgNoCountry.pem diff --git a/testlint/testCerts/orgNoLocal.pem b/testdata/orgNoLocal.pem similarity index 100% rename from testlint/testCerts/orgNoLocal.pem rename to testdata/orgNoLocal.pem diff --git a/testlint/testCerts/orgNoProv.pem b/testdata/orgNoProv.pem similarity index 100% rename from testlint/testCerts/orgNoProv.pem rename to testdata/orgNoProv.pem diff --git a/testlint/testCerts/orgValAllBad.pem b/testdata/orgValAllBad.pem similarity index 100% rename from testlint/testCerts/orgValAllBad.pem rename to testdata/orgValAllBad.pem diff --git a/testlint/testCerts/orgValGoodAllFields.pem b/testdata/orgValGoodAllFields.pem similarity index 100% rename from testlint/testCerts/orgValGoodAllFields.pem rename to testdata/orgValGoodAllFields.pem diff --git a/testlint/testCerts/orgValGoodNoLocal.pem b/testdata/orgValGoodNoLocal.pem similarity index 100% rename from testlint/testCerts/orgValGoodNoLocal.pem rename to testdata/orgValGoodNoLocal.pem diff --git a/testlint/testCerts/orgValGoodNoProvince.pem b/testdata/orgValGoodNoProvince.pem similarity index 100% rename from testlint/testCerts/orgValGoodNoProvince.pem rename to testdata/orgValGoodNoProvince.pem diff --git a/testlint/testCerts/orgValNoCountry.pem b/testdata/orgValNoCountry.pem similarity index 100% rename from testlint/testCerts/orgValNoCountry.pem rename to testdata/orgValNoCountry.pem diff --git a/testlint/testCerts/orgValNoOrg.pem b/testdata/orgValNoOrg.pem similarity index 100% rename from testlint/testCerts/orgValNoOrg.pem rename to testdata/orgValNoOrg.pem diff --git a/testlint/testCerts/orgValNoProvinceOrLocal.pem b/testdata/orgValNoProvinceOrLocal.pem similarity index 100% rename from testlint/testCerts/orgValNoProvinceOrLocal.pem rename to testdata/orgValNoProvinceOrLocal.pem diff --git a/testlint/testCerts/orgYesCountry.pem b/testdata/orgYesCountry.pem similarity index 100% rename from testlint/testCerts/orgYesCountry.pem rename to testdata/orgYesCountry.pem diff --git a/testlint/testCerts/policyConstEmpty.pem b/testdata/policyConstEmpty.pem similarity index 100% rename from testlint/testCerts/policyConstEmpty.pem rename to testdata/policyConstEmpty.pem diff --git a/testlint/testCerts/policyConstGoodBoth.pem b/testdata/policyConstGoodBoth.pem similarity index 100% rename from testlint/testCerts/policyConstGoodBoth.pem rename to testdata/policyConstGoodBoth.pem diff --git a/testlint/testCerts/policyConstGoodOnlyExplicit.pem b/testdata/policyConstGoodOnlyExplicit.pem similarity index 100% rename from testlint/testCerts/policyConstGoodOnlyExplicit.pem rename to testdata/policyConstGoodOnlyExplicit.pem diff --git a/testlint/testCerts/policyConstGoodOnlyInhibit.pem b/testdata/policyConstGoodOnlyInhibit.pem similarity index 100% rename from testlint/testCerts/policyConstGoodOnlyInhibit.pem rename to testdata/policyConstGoodOnlyInhibit.pem diff --git a/testlint/testCerts/policyConstNotCritical.pem b/testdata/policyConstNotCritical.pem similarity index 100% rename from testlint/testCerts/policyConstNotCritical.pem rename to testdata/policyConstNotCritical.pem diff --git a/testlint/testCerts/policyMapAnyPolNotAsserted.pem b/testdata/policyMapAnyPolNotAsserted.pem similarity index 100% rename from testlint/testCerts/policyMapAnyPolNotAsserted.pem rename to testdata/policyMapAnyPolNotAsserted.pem diff --git a/testlint/testCerts/policyMapFromAnyPolicy.pem b/testdata/policyMapFromAnyPolicy.pem similarity index 100% rename from testlint/testCerts/policyMapFromAnyPolicy.pem rename to testdata/policyMapFromAnyPolicy.pem diff --git a/testlint/testCerts/policyMapGood.pem b/testdata/policyMapGood.pem similarity index 100% rename from testlint/testCerts/policyMapGood.pem rename to testdata/policyMapGood.pem diff --git a/testlint/testCerts/policyMapIssuerNotInCertPolicy.pem b/testdata/policyMapIssuerNotInCertPolicy.pem similarity index 100% rename from testlint/testCerts/policyMapIssuerNotInCertPolicy.pem rename to testdata/policyMapIssuerNotInCertPolicy.pem diff --git a/testlint/testCerts/policyMapNotCritical.pem b/testdata/policyMapNotCritical.pem similarity index 100% rename from testlint/testCerts/policyMapNotCritical.pem rename to testdata/policyMapNotCritical.pem diff --git a/testlint/testCerts/policyMapToAnyPolicy.pem b/testdata/policyMapToAnyPolicy.pem similarity index 100% rename from testlint/testCerts/policyMapToAnyPolicy.pem rename to testdata/policyMapToAnyPolicy.pem diff --git a/testlint/testCerts/postalNoOrg.pem b/testdata/postalNoOrg.pem similarity index 100% rename from testlint/testCerts/postalNoOrg.pem rename to testdata/postalNoOrg.pem diff --git a/testlint/testCerts/postalYesOrg.pem b/testdata/postalYesOrg.pem similarity index 100% rename from testlint/testCerts/postalYesOrg.pem rename to testdata/postalYesOrg.pem diff --git a/testlint/testCerts/provNoOrg.pem b/testdata/provNoOrg.pem similarity index 100% rename from testlint/testCerts/provNoOrg.pem rename to testdata/provNoOrg.pem diff --git a/testlint/testCerts/provYesOrg.pem b/testdata/provYesOrg.pem similarity index 100% rename from testlint/testCerts/provYesOrg.pem rename to testdata/provYesOrg.pem diff --git a/testlint/testCerts/rootCAKeyUsageMissing.pem b/testdata/rootCAKeyUsageMissing.pem similarity index 100% rename from testlint/testCerts/rootCAKeyUsageMissing.pem rename to testdata/rootCAKeyUsageMissing.pem diff --git a/testlint/testCerts/rootCAKeyUsageNotCritical.pem b/testdata/rootCAKeyUsageNotCritical.pem similarity index 100% rename from testlint/testCerts/rootCAKeyUsageNotCritical.pem rename to testdata/rootCAKeyUsageNotCritical.pem diff --git a/testlint/testCerts/rootCAKeyUsagePresent.pem b/testdata/rootCAKeyUsagePresent.pem similarity index 100% rename from testlint/testCerts/rootCAKeyUsagePresent.pem rename to testdata/rootCAKeyUsagePresent.pem diff --git a/testlint/testCerts/rootCANoKeyIdentifiers.pem b/testdata/rootCANoKeyIdentifiers.pem similarity index 100% rename from testlint/testCerts/rootCANoKeyIdentifiers.pem rename to testdata/rootCANoKeyIdentifiers.pem diff --git a/testlint/testCerts/rootCAValid.pem b/testdata/rootCAValid.pem similarity index 100% rename from testlint/testCerts/rootCAValid.pem rename to testdata/rootCAValid.pem diff --git a/testlint/testCerts/rootCAWithCertPolicy.pem b/testdata/rootCAWithCertPolicy.pem similarity index 100% rename from testlint/testCerts/rootCAWithCertPolicy.pem rename to testdata/rootCAWithCertPolicy.pem diff --git a/testlint/testCerts/rootCAWithEKU.pem b/testdata/rootCAWithEKU.pem similarity index 100% rename from testlint/testCerts/rootCAWithEKU.pem rename to testdata/rootCAWithEKU.pem diff --git a/testlint/testCerts/rootCAWithEKUCertPolicy.pem b/testdata/rootCAWithEKUCertPolicy.pem similarity index 100% rename from testlint/testCerts/rootCAWithEKUCertPolicy.pem rename to testdata/rootCAWithEKUCertPolicy.pem diff --git a/testlint/testCerts/rootCAWithKeyIdentifiers.pem b/testdata/rootCAWithKeyIdentifiers.pem similarity index 100% rename from testlint/testCerts/rootCAWithKeyIdentifiers.pem rename to testdata/rootCAWithKeyIdentifiers.pem diff --git a/testlint/testCerts/rootCaMaxPathLenMissing.pem b/testdata/rootCaMaxPathLenMissing.pem similarity index 100% rename from testlint/testCerts/rootCaMaxPathLenMissing.pem rename to testdata/rootCaMaxPathLenMissing.pem diff --git a/testlint/testCerts/rootCaMaxPathLenPresent.pem b/testdata/rootCaMaxPathLenPresent.pem similarity index 100% rename from testlint/testCerts/rootCaMaxPathLenPresent.pem rename to testdata/rootCaMaxPathLenPresent.pem diff --git a/testlint/testCerts/rsaAlgIDNoNULLParams.pem b/testdata/rsaAlgIDNoNULLParams.pem similarity index 100% rename from testlint/testCerts/rsaAlgIDNoNULLParams.pem rename to testdata/rsaAlgIDNoNULLParams.pem diff --git a/testlint/testCerts/rsaKeyWithParameters.pem b/testdata/rsaKeyWithParameters.pem similarity index 100% rename from testlint/testCerts/rsaKeyWithParameters.pem rename to testdata/rsaKeyWithParameters.pem diff --git a/testlint/testCerts/rsaSigAlgoNoNULLParam.pem b/testdata/rsaSigAlgoNoNULLParam.pem similarity index 100% rename from testlint/testCerts/rsaSigAlgoNoNULLParam.pem rename to testdata/rsaSigAlgoNoNULLParam.pem diff --git a/testlint/testCerts/rsawithsha1after2016.pem b/testdata/rsawithsha1after2016.pem similarity index 100% rename from testlint/testCerts/rsawithsha1after2016.pem rename to testdata/rsawithsha1after2016.pem diff --git a/testlint/testCerts/rsawithsha1before2016.pem b/testdata/rsawithsha1before2016.pem similarity index 100% rename from testlint/testCerts/rsawithsha1before2016.pem rename to testdata/rsawithsha1before2016.pem diff --git a/testlint/testCerts/sanPrivatePublicSuffix.pem b/testdata/sanPrivatePublicSuffix.pem similarity index 100% rename from testlint/testCerts/sanPrivatePublicSuffix.pem rename to testdata/sanPrivatePublicSuffix.pem diff --git a/testlint/testCerts/serialNumberLarge.pem b/testdata/serialNumberLarge.pem similarity index 100% rename from testlint/testCerts/serialNumberLarge.pem rename to testdata/serialNumberLarge.pem diff --git a/testlint/testCerts/serialNumberNegative.pem b/testdata/serialNumberNegative.pem similarity index 100% rename from testlint/testCerts/serialNumberNegative.pem rename to testdata/serialNumberNegative.pem diff --git a/testlint/testCerts/serialNumberValid.pem b/testdata/serialNumberValid.pem similarity index 100% rename from testlint/testCerts/serialNumberValid.pem rename to testdata/serialNumberValid.pem diff --git a/testlint/testCerts/sha1ExpireAfter2017.pem b/testdata/sha1ExpireAfter2017.pem similarity index 100% rename from testlint/testCerts/sha1ExpireAfter2017.pem rename to testdata/sha1ExpireAfter2017.pem diff --git a/testlint/testCerts/sha1ExpirePrior2017.pem b/testdata/sha1ExpirePrior2017.pem similarity index 100% rename from testlint/testCerts/sha1ExpirePrior2017.pem rename to testdata/sha1ExpirePrior2017.pem diff --git a/testlint/testCerts/sha1WithRSASignatureAlgorithm.pem b/testdata/sha1WithRSASignatureAlgorithm.pem similarity index 100% rename from testlint/testCerts/sha1WithRSASignatureAlgorithm.pem rename to testdata/sha1WithRSASignatureAlgorithm.pem diff --git a/testlint/testCerts/sha256WithRSAPSSSignatureAlgorithm.pem b/testdata/sha256WithRSAPSSSignatureAlgorithm.pem similarity index 100% rename from testlint/testCerts/sha256WithRSAPSSSignatureAlgorithm.pem rename to testdata/sha256WithRSAPSSSignatureAlgorithm.pem diff --git a/testlint/testCerts/siaCrit.pem b/testdata/siaCrit.pem similarity index 100% rename from testlint/testCerts/siaCrit.pem rename to testdata/siaCrit.pem diff --git a/testlint/testCerts/siaNotCrit.pem b/testdata/siaNotCrit.pem similarity index 100% rename from testlint/testCerts/siaNotCrit.pem rename to testdata/siaNotCrit.pem diff --git a/testlint/testCerts/skiCritical.pem b/testdata/skiCritical.pem similarity index 100% rename from testlint/testCerts/skiCritical.pem rename to testdata/skiCritical.pem diff --git a/testlint/testCerts/skiCriticalCA.pem b/testdata/skiCriticalCA.pem similarity index 100% rename from testlint/testCerts/skiCriticalCA.pem rename to testdata/skiCriticalCA.pem diff --git a/testlint/testCerts/skiNotCriticalCA.pem b/testdata/skiNotCriticalCA.pem similarity index 100% rename from testlint/testCerts/skiNotCriticalCA.pem rename to testdata/skiNotCriticalCA.pem diff --git a/testlint/testCerts/streetAddressCanExist.pem b/testdata/streetAddressCanExist.pem similarity index 100% rename from testlint/testCerts/streetAddressCanExist.pem rename to testdata/streetAddressCanExist.pem diff --git a/testlint/testCerts/streetAddressCannotExist.pem b/testdata/streetAddressCannotExist.pem similarity index 100% rename from testlint/testCerts/streetAddressCannotExist.pem rename to testdata/streetAddressCannotExist.pem diff --git a/testlint/testCerts/streetNoOrg.pem b/testdata/streetNoOrg.pem similarity index 100% rename from testlint/testCerts/streetNoOrg.pem rename to testdata/streetNoOrg.pem diff --git a/testlint/testCerts/streetYesOrg.pem b/testdata/streetYesOrg.pem similarity index 100% rename from testlint/testCerts/streetYesOrg.pem rename to testdata/streetYesOrg.pem diff --git a/testlint/testCerts/subCAAIACrit.pem b/testdata/subCAAIACrit.pem similarity index 100% rename from testlint/testCerts/subCAAIACrit.pem rename to testdata/subCAAIACrit.pem diff --git a/testlint/testCerts/subCAAIAMarkedCritical.pem b/testdata/subCAAIAMarkedCritical.pem similarity index 100% rename from testlint/testCerts/subCAAIAMarkedCritical.pem rename to testdata/subCAAIAMarkedCritical.pem diff --git a/testlint/testCerts/subCAAIAMissing.pem b/testdata/subCAAIAMissing.pem similarity index 100% rename from testlint/testCerts/subCAAIAMissing.pem rename to testdata/subCAAIAMissing.pem diff --git a/testlint/testCerts/subCAAIANotMarkedCritical.pem b/testdata/subCAAIANotMarkedCritical.pem similarity index 100% rename from testlint/testCerts/subCAAIANotMarkedCritical.pem rename to testdata/subCAAIANotMarkedCritical.pem diff --git a/testlint/testCerts/subCAAIAValid.pem b/testdata/subCAAIAValid.pem similarity index 100% rename from testlint/testCerts/subCAAIAValid.pem rename to testdata/subCAAIAValid.pem diff --git a/testlint/testCerts/subCAEKUMissing.pem b/testdata/subCAEKUMissing.pem similarity index 100% rename from testlint/testCerts/subCAEKUMissing.pem rename to testdata/subCAEKUMissing.pem diff --git a/testlint/testCerts/subCAEKUNotMissing.pem b/testdata/subCAEKUNotMissing.pem similarity index 100% rename from testlint/testCerts/subCAEKUNotMissing.pem rename to testdata/subCAEKUNotMissing.pem diff --git a/testlint/testCerts/subCAEKUNotValidFields.pem b/testdata/subCAEKUNotValidFields.pem similarity index 100% rename from testlint/testCerts/subCAEKUNotValidFields.pem rename to testdata/subCAEKUNotValidFields.pem diff --git a/testlint/testCerts/subCAEKUValidFields.pem b/testdata/subCAEKUValidFields.pem similarity index 100% rename from testlint/testCerts/subCAEKUValidFields.pem rename to testdata/subCAEKUValidFields.pem diff --git a/testlint/testCerts/subCANoSKI.pem b/testdata/subCANoSKI.pem similarity index 100% rename from testlint/testCerts/subCANoSKI.pem rename to testdata/subCANoSKI.pem diff --git a/testlint/testCerts/subCAWBothURL.pem b/testdata/subCAWBothURL.pem similarity index 100% rename from testlint/testCerts/subCAWBothURL.pem rename to testdata/subCAWBothURL.pem diff --git a/testlint/testCerts/subCAWCertPolicyCrit.pem b/testdata/subCAWCertPolicyCrit.pem similarity index 100% rename from testlint/testCerts/subCAWCertPolicyCrit.pem rename to testdata/subCAWCertPolicyCrit.pem diff --git a/testlint/testCerts/subCAWCertPolicyNoCrit.pem b/testdata/subCAWCertPolicyNoCrit.pem similarity index 100% rename from testlint/testCerts/subCAWCertPolicyNoCrit.pem rename to testdata/subCAWCertPolicyNoCrit.pem diff --git a/testlint/testCerts/subCAWEkuCrit.pem b/testdata/subCAWEkuCrit.pem similarity index 100% rename from testlint/testCerts/subCAWEkuCrit.pem rename to testdata/subCAWEkuCrit.pem diff --git a/testlint/testCerts/subCAWEkuNoCrit.pem b/testdata/subCAWEkuNoCrit.pem similarity index 100% rename from testlint/testCerts/subCAWEkuNoCrit.pem rename to testdata/subCAWEkuNoCrit.pem diff --git a/testlint/testCerts/subCAWIssuerURL.pem b/testdata/subCAWIssuerURL.pem similarity index 100% rename from testlint/testCerts/subCAWIssuerURL.pem rename to testdata/subCAWIssuerURL.pem diff --git a/testlint/testCerts/subCAWNameConstCrit.pem b/testdata/subCAWNameConstCrit.pem similarity index 100% rename from testlint/testCerts/subCAWNameConstCrit.pem rename to testdata/subCAWNameConstCrit.pem diff --git a/testlint/testCerts/subCAWNameConstNoCrit.pem b/testdata/subCAWNameConstNoCrit.pem similarity index 100% rename from testlint/testCerts/subCAWNameConstNoCrit.pem rename to testdata/subCAWNameConstNoCrit.pem diff --git a/testlint/testCerts/subCAWNoCertPolicy.pem b/testdata/subCAWNoCertPolicy.pem similarity index 100% rename from testlint/testCerts/subCAWNoCertPolicy.pem rename to testdata/subCAWNoCertPolicy.pem diff --git a/testlint/testCerts/subCAWNoNameConst.pem b/testdata/subCAWNoNameConst.pem similarity index 100% rename from testlint/testCerts/subCAWNoNameConst.pem rename to testdata/subCAWNoNameConst.pem diff --git a/testlint/testCerts/subCAWNoURL.pem b/testdata/subCAWNoURL.pem similarity index 100% rename from testlint/testCerts/subCAWNoURL.pem rename to testdata/subCAWNoURL.pem diff --git a/testlint/testCerts/subCAWNocrlDist.pem b/testdata/subCAWNocrlDist.pem similarity index 100% rename from testlint/testCerts/subCAWNocrlDist.pem rename to testdata/subCAWNocrlDist.pem diff --git a/testlint/testCerts/subCAWOcspURL.pem b/testdata/subCAWOcspURL.pem similarity index 100% rename from testlint/testCerts/subCAWOcspURL.pem rename to testdata/subCAWOcspURL.pem diff --git a/testlint/testCerts/subCAWcrlDistCrit.pem b/testdata/subCAWcrlDistCrit.pem similarity index 100% rename from testlint/testCerts/subCAWcrlDistCrit.pem rename to testdata/subCAWcrlDistCrit.pem diff --git a/testlint/testCerts/subCAWcrlDistNoCrit.pem b/testdata/subCAWcrlDistNoCrit.pem similarity index 100% rename from testlint/testCerts/subCAWcrlDistNoCrit.pem rename to testdata/subCAWcrlDistNoCrit.pem diff --git a/testlint/testCerts/subCAWithAnyPolicy.pem b/testdata/subCAWithAnyPolicy.pem similarity index 100% rename from testlint/testCerts/subCAWithAnyPolicy.pem rename to testdata/subCAWithAnyPolicy.pem diff --git a/testlint/testCerts/subCAcrlDistNoURL.pem b/testdata/subCAcrlDistNoURL.pem similarity index 100% rename from testlint/testCerts/subCAcrlDistNoURL.pem rename to testdata/subCAcrlDistNoURL.pem diff --git a/testlint/testCerts/subCaCrlMissing.pem b/testdata/subCaCrlMissing.pem similarity index 100% rename from testlint/testCerts/subCaCrlMissing.pem rename to testdata/subCaCrlMissing.pem diff --git a/testlint/testCerts/subCaCrlPresent.pem b/testdata/subCaCrlPresent.pem similarity index 100% rename from testlint/testCerts/subCaCrlPresent.pem rename to testdata/subCaCrlPresent.pem diff --git a/testlint/testCerts/subCaEmptySubject.pem b/testdata/subCaEmptySubject.pem similarity index 100% rename from testlint/testCerts/subCaEmptySubject.pem rename to testdata/subCaEmptySubject.pem diff --git a/testlint/testCerts/subCaNoCertPolicy.pem b/testdata/subCaNoCertPolicy.pem similarity index 100% rename from testlint/testCerts/subCaNoCertPolicy.pem rename to testdata/subCaNoCertPolicy.pem diff --git a/testlint/testCerts/subCaNokeyUsage.pem b/testdata/subCaNokeyUsage.pem similarity index 100% rename from testlint/testCerts/subCaNokeyUsage.pem rename to testdata/subCaNokeyUsage.pem diff --git a/testlint/testCerts/subCert825DaysOK.pem b/testdata/subCert825DaysOK.pem similarity index 100% rename from testlint/testCerts/subCert825DaysOK.pem rename to testdata/subCert825DaysOK.pem diff --git a/testlint/testCerts/subCertAIAMarkedCritical.pem b/testdata/subCertAIAMarkedCritical.pem similarity index 100% rename from testlint/testCerts/subCertAIAMarkedCritical.pem rename to testdata/subCertAIAMarkedCritical.pem diff --git a/testlint/testCerts/subCertAIAMissing.pem b/testdata/subCertAIAMissing.pem similarity index 100% rename from testlint/testCerts/subCertAIAMissing.pem rename to testdata/subCertAIAMissing.pem diff --git a/testlint/testCerts/subCertAIANotMarkedCritical.pem b/testdata/subCertAIANotMarkedCritical.pem similarity index 100% rename from testlint/testCerts/subCertAIANotMarkedCritical.pem rename to testdata/subCertAIANotMarkedCritical.pem diff --git a/testlint/testCerts/subCertCountryNameMustAppear.pem b/testdata/subCertCountryNameMustAppear.pem similarity index 100% rename from testlint/testCerts/subCertCountryNameMustAppear.pem rename to testdata/subCertCountryNameMustAppear.pem diff --git a/testlint/testCerts/subCertEmptySubject.pem b/testdata/subCertEmptySubject.pem similarity index 100% rename from testlint/testCerts/subCertEmptySubject.pem rename to testdata/subCertEmptySubject.pem diff --git a/testlint/testCerts/subCertIsCA.pem b/testdata/subCertIsCA.pem similarity index 100% rename from testlint/testCerts/subCertIsCA.pem rename to testdata/subCertIsCA.pem diff --git a/testlint/testCerts/subCertIsNotCA.pem b/testdata/subCertIsNotCA.pem similarity index 100% rename from testlint/testCerts/subCertIsNotCA.pem rename to testdata/subCertIsNotCA.pem diff --git a/testlint/testCerts/subCertLocalityNameDoesNotNeedToAppear.pem b/testdata/subCertLocalityNameDoesNotNeedToAppear.pem similarity index 100% rename from testlint/testCerts/subCertLocalityNameDoesNotNeedToAppear.pem rename to testdata/subCertLocalityNameDoesNotNeedToAppear.pem diff --git a/testlint/testCerts/subCertLocalityNameMustAppear.pem b/testdata/subCertLocalityNameMustAppear.pem similarity index 100% rename from testlint/testCerts/subCertLocalityNameMustAppear.pem rename to testdata/subCertLocalityNameMustAppear.pem diff --git a/testlint/testCerts/subCertLocalityNameNotProhibited.pem b/testdata/subCertLocalityNameNotProhibited.pem similarity index 100% rename from testlint/testCerts/subCertLocalityNameNotProhibited.pem rename to testdata/subCertLocalityNameNotProhibited.pem diff --git a/testlint/testCerts/subCertLocalityNameProhibited.pem b/testdata/subCertLocalityNameProhibited.pem similarity index 100% rename from testlint/testCerts/subCertLocalityNameProhibited.pem rename to testdata/subCertLocalityNameProhibited.pem diff --git a/testlint/testCerts/subCertNoCertPolicy.pem b/testdata/subCertNoCertPolicy.pem similarity index 100% rename from testlint/testCerts/subCertNoCertPolicy.pem rename to testdata/subCertNoCertPolicy.pem diff --git a/testlint/testCerts/subCertNoKeyUsage.pem b/testdata/subCertNoKeyUsage.pem similarity index 100% rename from testlint/testCerts/subCertNoKeyUsage.pem rename to testdata/subCertNoKeyUsage.pem diff --git a/testlint/testCerts/subCertNoSKI.pem b/testdata/subCertNoSKI.pem similarity index 100% rename from testlint/testCerts/subCertNoSKI.pem rename to testdata/subCertNoSKI.pem diff --git a/testlint/testCerts/subCertOver825DaysBad.pem b/testdata/subCertOver825DaysBad.pem similarity index 100% rename from testlint/testCerts/subCertOver825DaysBad.pem rename to testdata/subCertOver825DaysBad.pem diff --git a/testlint/testCerts/subCertOver825DaysOK.pem b/testdata/subCertOver825DaysOK.pem similarity index 100% rename from testlint/testCerts/subCertOver825DaysOK.pem rename to testdata/subCertOver825DaysOK.pem diff --git a/testlint/testCerts/subCertPathLenNegative.pem b/testdata/subCertPathLenNegative.pem similarity index 100% rename from testlint/testCerts/subCertPathLenNegative.pem rename to testdata/subCertPathLenNegative.pem diff --git a/testlint/testCerts/subCertPathLenPositive.pem b/testdata/subCertPathLenPositive.pem similarity index 100% rename from testlint/testCerts/subCertPathLenPositive.pem rename to testdata/subCertPathLenPositive.pem diff --git a/testlint/testCerts/subCertPolicyCrit.pem b/testdata/subCertPolicyCrit.pem similarity index 100% rename from testlint/testCerts/subCertPolicyCrit.pem rename to testdata/subCertPolicyCrit.pem diff --git a/testlint/testCerts/subCertPolicyMissing.pem b/testdata/subCertPolicyMissing.pem similarity index 100% rename from testlint/testCerts/subCertPolicyMissing.pem rename to testdata/subCertPolicyMissing.pem diff --git a/testlint/testCerts/subCertPolicyNoCrit.pem b/testdata/subCertPolicyNoCrit.pem similarity index 100% rename from testlint/testCerts/subCertPolicyNoCrit.pem rename to testdata/subCertPolicyNoCrit.pem diff --git a/testlint/testCerts/subCertPostalCodeNotProhibited.pem b/testdata/subCertPostalCodeNotProhibited.pem similarity index 100% rename from testlint/testCerts/subCertPostalCodeNotProhibited.pem rename to testdata/subCertPostalCodeNotProhibited.pem diff --git a/testlint/testCerts/subCertPostalCodeProhibited.pem b/testdata/subCertPostalCodeProhibited.pem similarity index 100% rename from testlint/testCerts/subCertPostalCodeProhibited.pem rename to testdata/subCertPostalCodeProhibited.pem diff --git a/testlint/testCerts/subCertProvinceCanAppear.pem b/testdata/subCertProvinceCanAppear.pem similarity index 100% rename from testlint/testCerts/subCertProvinceCanAppear.pem rename to testdata/subCertProvinceCanAppear.pem diff --git a/testlint/testCerts/subCertProvinceMustNotAppear.pem b/testdata/subCertProvinceMustNotAppear.pem similarity index 100% rename from testlint/testCerts/subCertProvinceMustNotAppear.pem rename to testdata/subCertProvinceMustNotAppear.pem diff --git a/testlint/testCerts/subCertProvinceNotProhibited.pem b/testdata/subCertProvinceNotProhibited.pem similarity index 100% rename from testlint/testCerts/subCertProvinceNotProhibited.pem rename to testdata/subCertProvinceNotProhibited.pem diff --git a/testlint/testCerts/subCertProvinceProhibited.pem b/testdata/subCertProvinceProhibited.pem similarity index 100% rename from testlint/testCerts/subCertProvinceProhibited.pem rename to testdata/subCertProvinceProhibited.pem diff --git a/testlint/testCerts/subCertValidTimeGood.pem b/testdata/subCertValidTimeGood.pem similarity index 100% rename from testlint/testCerts/subCertValidTimeGood.pem rename to testdata/subCertValidTimeGood.pem diff --git a/testlint/testCerts/subCertValidTimeTooLong.pem b/testdata/subCertValidTimeTooLong.pem similarity index 100% rename from testlint/testCerts/subCertValidTimeTooLong.pem rename to testdata/subCertValidTimeTooLong.pem diff --git a/testlint/testCerts/subCertWBothURL.pem b/testdata/subCertWBothURL.pem similarity index 100% rename from testlint/testCerts/subCertWBothURL.pem rename to testdata/subCertWBothURL.pem diff --git a/testlint/testCerts/subCertWIssuerURL.pem b/testdata/subCertWIssuerURL.pem similarity index 100% rename from testlint/testCerts/subCertWIssuerURL.pem rename to testdata/subCertWIssuerURL.pem diff --git a/testlint/testCerts/subCertWNoURL.pem b/testdata/subCertWNoURL.pem similarity index 100% rename from testlint/testCerts/subCertWNoURL.pem rename to testdata/subCertWNoURL.pem diff --git a/testlint/testCerts/subCertWOcspURL.pem b/testdata/subCertWOcspURL.pem similarity index 100% rename from testlint/testCerts/subCertWOcspURL.pem rename to testdata/subCertWOcspURL.pem diff --git a/testlint/testCerts/subCrlDistCrit.pem b/testdata/subCrlDistCrit.pem similarity index 100% rename from testlint/testCerts/subCrlDistCrit.pem rename to testdata/subCrlDistCrit.pem diff --git a/testlint/testCerts/subCrlDistNoCrit.pem b/testdata/subCrlDistNoCrit.pem similarity index 100% rename from testlint/testCerts/subCrlDistNoCrit.pem rename to testdata/subCrlDistNoCrit.pem diff --git a/testlint/testCerts/subCrlDistNoURL.pem b/testdata/subCrlDistNoURL.pem similarity index 100% rename from testlint/testCerts/subCrlDistNoURL.pem rename to testdata/subCrlDistNoURL.pem diff --git a/testlint/testCerts/subCrlDistURL.pem b/testdata/subCrlDistURL.pem similarity index 100% rename from testlint/testCerts/subCrlDistURL.pem rename to testdata/subCrlDistURL.pem diff --git a/testlint/testCerts/subCrlDistURLInCompoundFullName.pem b/testdata/subCrlDistURLInCompoundFullName.pem similarity index 100% rename from testlint/testCerts/subCrlDistURLInCompoundFullName.pem rename to testdata/subCrlDistURLInCompoundFullName.pem diff --git a/testlint/testCerts/subDirAttCritical.pem b/testdata/subDirAttCritical.pem similarity index 100% rename from testlint/testCerts/subDirAttCritical.pem rename to testdata/subDirAttCritical.pem diff --git a/testlint/testCerts/subExtKeyUsageClient.pem b/testdata/subExtKeyUsageClient.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageClient.pem rename to testdata/subExtKeyUsageClient.pem diff --git a/testlint/testCerts/subExtKeyUsageCodeSign.pem b/testdata/subExtKeyUsageCodeSign.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageCodeSign.pem rename to testdata/subExtKeyUsageCodeSign.pem diff --git a/testlint/testCerts/subExtKeyUsageMissing.pem b/testdata/subExtKeyUsageMissing.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageMissing.pem rename to testdata/subExtKeyUsageMissing.pem diff --git a/testlint/testCerts/subExtKeyUsageServ.pem b/testdata/subExtKeyUsageServ.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageServ.pem rename to testdata/subExtKeyUsageServ.pem diff --git a/testlint/testCerts/subExtKeyUsageServClient.pem b/testdata/subExtKeyUsageServClient.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageServClient.pem rename to testdata/subExtKeyUsageServClient.pem diff --git a/testlint/testCerts/subExtKeyUsageServClientEmail.pem b/testdata/subExtKeyUsageServClientEmail.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageServClientEmail.pem rename to testdata/subExtKeyUsageServClientEmail.pem diff --git a/testlint/testCerts/subExtKeyUsageServClientEmailCodeSign.pem b/testdata/subExtKeyUsageServClientEmailCodeSign.pem similarity index 100% rename from testlint/testCerts/subExtKeyUsageServClientEmailCodeSign.pem rename to testdata/subExtKeyUsageServClientEmailCodeSign.pem diff --git a/testlint/testCerts/subKeyUsageInvalid.pem b/testdata/subKeyUsageInvalid.pem similarity index 100% rename from testlint/testCerts/subKeyUsageInvalid.pem rename to testdata/subKeyUsageInvalid.pem diff --git a/testlint/testCerts/subKeyUsageValid.pem b/testdata/subKeyUsageValid.pem similarity index 100% rename from testlint/testCerts/subKeyUsageValid.pem rename to testdata/subKeyUsageValid.pem diff --git a/testlint/testCerts/subjectCommonNameLengthGood.pem b/testdata/subjectCommonNameLengthGood.pem similarity index 100% rename from testlint/testCerts/subjectCommonNameLengthGood.pem rename to testdata/subjectCommonNameLengthGood.pem diff --git a/testlint/testCerts/subjectCommonNameLong.pem b/testdata/subjectCommonNameLong.pem similarity index 100% rename from testlint/testCerts/subjectCommonNameLong.pem rename to testdata/subjectCommonNameLong.pem diff --git a/testlint/testCerts/subjectCommonNamePrintableStringBadAlpha.pem b/testdata/subjectCommonNamePrintableStringBadAlpha.pem similarity index 100% rename from testlint/testCerts/subjectCommonNamePrintableStringBadAlpha.pem rename to testdata/subjectCommonNamePrintableStringBadAlpha.pem diff --git a/testlint/testCerts/subjectDNLeadingSpace.pem b/testdata/subjectDNLeadingSpace.pem similarity index 100% rename from testlint/testCerts/subjectDNLeadingSpace.pem rename to testdata/subjectDNLeadingSpace.pem diff --git a/testlint/testCerts/subjectDNNotPrintableCharacters.pem b/testdata/subjectDNNotPrintableCharacters.pem similarity index 100% rename from testlint/testCerts/subjectDNNotPrintableCharacters.pem rename to testdata/subjectDNNotPrintableCharacters.pem diff --git a/testlint/testCerts/subjectDNNotPrintableCharsUTF8.pem b/testdata/subjectDNNotPrintableCharsUTF8.pem similarity index 100% rename from testlint/testCerts/subjectDNNotPrintableCharsUTF8.pem rename to testdata/subjectDNNotPrintableCharsUTF8.pem diff --git a/testlint/testCerts/subjectDNTrailingSpace.pem b/testdata/subjectDNTrailingSpace.pem similarity index 100% rename from testlint/testCerts/subjectDNTrailingSpace.pem rename to testdata/subjectDNTrailingSpace.pem diff --git a/testlint/testCerts/subjectEmailPresent.pem b/testdata/subjectEmailPresent.pem similarity index 100% rename from testlint/testCerts/subjectEmailPresent.pem rename to testdata/subjectEmailPresent.pem diff --git a/testlint/testCerts/subjectEmptyNoSAN.pem b/testdata/subjectEmptyNoSAN.pem similarity index 100% rename from testlint/testCerts/subjectEmptyNoSAN.pem rename to testdata/subjectEmptyNoSAN.pem diff --git a/testlint/testCerts/subjectGivenName.pem b/testdata/subjectGivenName.pem similarity index 100% rename from testlint/testCerts/subjectGivenName.pem rename to testdata/subjectGivenName.pem diff --git a/testlint/testCerts/subjectGivenNameToolLong.pem b/testdata/subjectGivenNameToolLong.pem similarity index 100% rename from testlint/testCerts/subjectGivenNameToolLong.pem rename to testdata/subjectGivenNameToolLong.pem diff --git a/testlint/testCerts/subjectGoodIP.pem b/testdata/subjectGoodIP.pem similarity index 100% rename from testlint/testCerts/subjectGoodIP.pem rename to testdata/subjectGoodIP.pem diff --git a/testlint/testCerts/subjectInvalidCountry.pem b/testdata/subjectInvalidCountry.pem similarity index 100% rename from testlint/testCerts/subjectInvalidCountry.pem rename to testdata/subjectInvalidCountry.pem diff --git a/testlint/testCerts/subjectLocalityNameLengthGood.pem b/testdata/subjectLocalityNameLengthGood.pem similarity index 100% rename from testlint/testCerts/subjectLocalityNameLengthGood.pem rename to testdata/subjectLocalityNameLengthGood.pem diff --git a/testlint/testCerts/subjectLocalityNameLong.pem b/testdata/subjectLocalityNameLong.pem similarity index 100% rename from testlint/testCerts/subjectLocalityNameLong.pem rename to testdata/subjectLocalityNameLong.pem diff --git a/testlint/testCerts/subjectOrganizationNameLengthGood.pem b/testdata/subjectOrganizationNameLengthGood.pem similarity index 100% rename from testlint/testCerts/subjectOrganizationNameLengthGood.pem rename to testdata/subjectOrganizationNameLengthGood.pem diff --git a/testlint/testCerts/subjectOrganizationNameLong.pem b/testdata/subjectOrganizationNameLong.pem similarity index 100% rename from testlint/testCerts/subjectOrganizationNameLong.pem rename to testdata/subjectOrganizationNameLong.pem diff --git a/testlint/testCerts/subjectOrganizationalUnitNameLengthGood.pem b/testdata/subjectOrganizationalUnitNameLengthGood.pem similarity index 100% rename from testlint/testCerts/subjectOrganizationalUnitNameLengthGood.pem rename to testdata/subjectOrganizationalUnitNameLengthGood.pem diff --git a/testlint/testCerts/subjectOrganizationalUnitNameLong.pem b/testdata/subjectOrganizationalUnitNameLong.pem similarity index 100% rename from testlint/testCerts/subjectOrganizationalUnitNameLong.pem rename to testdata/subjectOrganizationalUnitNameLong.pem diff --git a/testlint/testCerts/subjectPostalCode.pem b/testdata/subjectPostalCode.pem similarity index 100% rename from testlint/testCerts/subjectPostalCode.pem rename to testdata/subjectPostalCode.pem diff --git a/testlint/testCerts/subjectPostalCodeTooLong.pem b/testdata/subjectPostalCodeTooLong.pem similarity index 100% rename from testlint/testCerts/subjectPostalCodeTooLong.pem rename to testdata/subjectPostalCodeTooLong.pem diff --git a/testlint/testCerts/subjectRDNSIPv4BadIP.pem b/testdata/subjectRDNSIPv4BadIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv4BadIP.pem rename to testdata/subjectRDNSIPv4BadIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv4GoodIP.pem b/testdata/subjectRDNSIPv4GoodIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv4GoodIP.pem rename to testdata/subjectRDNSIPv4GoodIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv4ReservedIP.pem b/testdata/subjectRDNSIPv4ReservedIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv4ReservedIP.pem rename to testdata/subjectRDNSIPv4ReservedIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv4TooFewLabels.pem b/testdata/subjectRDNSIPv4TooFewLabels.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv4TooFewLabels.pem rename to testdata/subjectRDNSIPv4TooFewLabels.pem diff --git a/testlint/testCerts/subjectRDNSIPv6BadIP.pem b/testdata/subjectRDNSIPv6BadIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv6BadIP.pem rename to testdata/subjectRDNSIPv6BadIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv6GoodIP.pem b/testdata/subjectRDNSIPv6GoodIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv6GoodIP.pem rename to testdata/subjectRDNSIPv6GoodIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv6ReservedIP.pem b/testdata/subjectRDNSIPv6ReservedIP.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv6ReservedIP.pem rename to testdata/subjectRDNSIPv6ReservedIP.pem diff --git a/testlint/testCerts/subjectRDNSIPv6TooFewLabels.pem b/testdata/subjectRDNSIPv6TooFewLabels.pem similarity index 100% rename from testlint/testCerts/subjectRDNSIPv6TooFewLabels.pem rename to testdata/subjectRDNSIPv6TooFewLabels.pem diff --git a/testlint/testCerts/subjectRDNTwoAttribute.pem b/testdata/subjectRDNTwoAttribute.pem similarity index 100% rename from testlint/testCerts/subjectRDNTwoAttribute.pem rename to testdata/subjectRDNTwoAttribute.pem diff --git a/testlint/testCerts/subjectReservedIP.pem b/testdata/subjectReservedIP.pem similarity index 100% rename from testlint/testCerts/subjectReservedIP.pem rename to testdata/subjectReservedIP.pem diff --git a/testlint/testCerts/subjectReservedIP6.pem b/testdata/subjectReservedIP6.pem similarity index 100% rename from testlint/testCerts/subjectReservedIP6.pem rename to testdata/subjectReservedIP6.pem diff --git a/testlint/testCerts/subjectStateNameLengthGood.pem b/testdata/subjectStateNameLengthGood.pem similarity index 100% rename from testlint/testCerts/subjectStateNameLengthGood.pem rename to testdata/subjectStateNameLengthGood.pem diff --git a/testlint/testCerts/subjectStateNameLong.pem b/testdata/subjectStateNameLong.pem similarity index 100% rename from testlint/testCerts/subjectStateNameLong.pem rename to testdata/subjectStateNameLong.pem diff --git a/testlint/testCerts/subjectStreetAddress.pem b/testdata/subjectStreetAddress.pem similarity index 100% rename from testlint/testCerts/subjectStreetAddress.pem rename to testdata/subjectStreetAddress.pem diff --git a/testlint/testCerts/subjectStreetAddressTooLong.pem b/testdata/subjectStreetAddressTooLong.pem similarity index 100% rename from testlint/testCerts/subjectStreetAddressTooLong.pem rename to testdata/subjectStreetAddressTooLong.pem diff --git a/testlint/testCerts/subjectSurname.pem b/testdata/subjectSurname.pem similarity index 100% rename from testlint/testCerts/subjectSurname.pem rename to testdata/subjectSurname.pem diff --git a/testlint/testCerts/subjectSurnameTooLong.pem b/testdata/subjectSurnameTooLong.pem similarity index 100% rename from testlint/testCerts/subjectSurnameTooLong.pem rename to testdata/subjectSurnameTooLong.pem diff --git a/testlint/testCerts/subjectUID.pem b/testdata/subjectUID.pem similarity index 100% rename from testlint/testCerts/subjectUID.pem rename to testdata/subjectUID.pem diff --git a/testlint/testCerts/subjectValidCountry.pem b/testdata/subjectValidCountry.pem similarity index 100% rename from testlint/testCerts/subjectValidCountry.pem rename to testdata/subjectValidCountry.pem diff --git a/testlint/testCerts/subjectWithSingleQuote.pem b/testdata/subjectWithSingleQuote.pem similarity index 100% rename from testlint/testCerts/subjectWithSingleQuote.pem rename to testdata/subjectWithSingleQuote.pem diff --git a/testlint/testCerts/surnameCorrectPolicy.pem b/testdata/surnameCorrectPolicy.pem similarity index 100% rename from testlint/testCerts/surnameCorrectPolicy.pem rename to testdata/surnameCorrectPolicy.pem diff --git a/testlint/testCerts/surnameIncorrectPolicy.pem b/testdata/surnameIncorrectPolicy.pem similarity index 100% rename from testlint/testCerts/surnameIncorrectPolicy.pem rename to testdata/surnameIncorrectPolicy.pem diff --git a/testlint/testCerts/uniqueIdVersion1.pem b/testdata/uniqueIdVersion1.pem similarity index 100% rename from testlint/testCerts/uniqueIdVersion1.pem rename to testdata/uniqueIdVersion1.pem diff --git a/testlint/testCerts/uniqueIdVersion3.pem b/testdata/uniqueIdVersion3.pem similarity index 100% rename from testlint/testCerts/uniqueIdVersion3.pem rename to testdata/uniqueIdVersion3.pem diff --git a/testlint/testCerts/unknownpublickey.pem b/testdata/unknownpublickey.pem similarity index 100% rename from testlint/testCerts/unknownpublickey.pem rename to testdata/unknownpublickey.pem diff --git a/testlint/testCerts/userNoticeExpTextNotIA5String.pem b/testdata/userNoticeExpTextNotIA5String.pem similarity index 100% rename from testlint/testCerts/userNoticeExpTextNotIA5String.pem rename to testdata/userNoticeExpTextNotIA5String.pem diff --git a/testlint/testCerts/userNoticeExpTextUtf8.pem b/testdata/userNoticeExpTextUtf8.pem similarity index 100% rename from testlint/testCerts/userNoticeExpTextUtf8.pem rename to testdata/userNoticeExpTextUtf8.pem diff --git a/testlint/testCerts/userNoticeMissing.pem b/testdata/userNoticeMissing.pem similarity index 100% rename from testlint/testCerts/userNoticeMissing.pem rename to testdata/userNoticeMissing.pem diff --git a/testlint/testCerts/userNoticePres.pem b/testdata/userNoticePres.pem similarity index 100% rename from testlint/testCerts/userNoticePres.pem rename to testdata/userNoticePres.pem diff --git a/testlint/testCerts/userNoticeUnrecommended.pem b/testdata/userNoticeUnrecommended.pem similarity index 100% rename from testlint/testCerts/userNoticeUnrecommended.pem rename to testdata/userNoticeUnrecommended.pem diff --git a/testlint/testCerts/utcHasSeconds.pem b/testdata/utcHasSeconds.pem similarity index 100% rename from testlint/testCerts/utcHasSeconds.pem rename to testdata/utcHasSeconds.pem diff --git a/testlint/testCerts/utcNoSeconds.pem b/testdata/utcNoSeconds.pem similarity index 100% rename from testlint/testCerts/utcNoSeconds.pem rename to testdata/utcNoSeconds.pem diff --git a/testlint/testCerts/utcNotZulu.pem b/testdata/utcNotZulu.pem similarity index 100% rename from testlint/testCerts/utcNotZulu.pem rename to testdata/utcNotZulu.pem diff --git a/testlint/testCerts/utf8ControlX10.pem b/testdata/utf8ControlX10.pem similarity index 100% rename from testlint/testCerts/utf8ControlX10.pem rename to testdata/utf8ControlX10.pem diff --git a/testlint/testCerts/utf8ControlX88.pem b/testdata/utf8ControlX88.pem similarity index 100% rename from testlint/testCerts/utf8ControlX88.pem rename to testdata/utf8ControlX88.pem diff --git a/testlint/testCerts/utf8NoControl.pem b/testdata/utf8NoControl.pem similarity index 100% rename from testlint/testCerts/utf8NoControl.pem rename to testdata/utf8NoControl.pem diff --git a/testlint/testCerts/validComodo.pem b/testdata/validComodo.pem similarity index 100% rename from testlint/testCerts/validComodo.pem rename to testdata/validComodo.pem diff --git a/testlint/testCerts/validRsaExpRange.pem b/testdata/validRsaExpRange.pem similarity index 100% rename from testlint/testCerts/validRsaExpRange.pem rename to testdata/validRsaExpRange.pem diff --git a/testlint/testCerts/validityNegative.pem b/testdata/validityNegative.pem similarity index 100% rename from testlint/testCerts/validityNegative.pem rename to testdata/validityNegative.pem diff --git a/testlint/testCerts/yesDN.pem b/testdata/yesDN.pem similarity index 100% rename from testlint/testCerts/yesDN.pem rename to testdata/yesDN.pem diff --git a/testlint/testCerts/yesNameConstraint.pem b/testdata/yesNameConstraint.pem similarity index 100% rename from testlint/testCerts/yesNameConstraint.pem rename to testdata/yesNameConstraint.pem diff --git a/testlint/testCerts/yesPubExpRange.pem b/testdata/yesPubExpRange.pem similarity index 100% rename from testlint/testCerts/yesPubExpRange.pem rename to testdata/yesPubExpRange.pem diff --git a/testlint/testCerts/yesRsaLength.pem b/testdata/yesRsaLength.pem similarity index 100% rename from testlint/testCerts/yesRsaLength.pem rename to testdata/yesRsaLength.pem diff --git a/testlint/testDef/domainValDetectsAll.json b/testlint/testDef/domainValDetectsAll.json deleted file mode 100644 index e5157c23a..000000000 --- a/testlint/testDef/domainValDetectsAll.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":5,"Details":""},"cert_policy_conflicts_with_org":{"Result":5,"Details":""},"cert_policy_conflicts_with_postal":{"Result":5,"Details":""},"cert_policy_conflicts_with_province":{"Result":5,"Details":""},"cert_policy_conflicts_with_street":{"Result":5,"Details":""}} \ No newline at end of file diff --git a/testlint/testDef/domainValDetectsLocal.json b/testlint/testDef/domainValDetectsLocal.json deleted file mode 100644 index 9282c82bd..000000000 --- a/testlint/testDef/domainValDetectsLocal.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":5},"cert_policy_conflicts_with_org":{"Result":2},"cert_policy_conflicts_with_postal":{"Result":2},"cert_policy_conflicts_with_province":{"Result":2},"cert_policy_conflicts_with_street":{"Result":2}} \ No newline at end of file diff --git a/testlint/testDef/domainValDetectsOrg.json b/testlint/testDef/domainValDetectsOrg.json deleted file mode 100644 index 93736a435..000000000 --- a/testlint/testDef/domainValDetectsOrg.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":2},"cert_policy_conflicts_with_org":{"Result":5},"cert_policy_conflicts_with_postal":{"Result":2},"cert_policy_conflicts_with_province":{"Result":2},"cert_policy_conflicts_with_street":{"Result":2}} \ No newline at end of file diff --git a/testlint/testDef/domainValDetectsPostal.json b/testlint/testDef/domainValDetectsPostal.json deleted file mode 100644 index d82c7018b..000000000 --- a/testlint/testDef/domainValDetectsPostal.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":2},"cert_policy_conflicts_with_org":{"Result":2},"cert_policy_conflicts_with_postal":{"Result":5},"cert_policy_conflicts_with_province":{"Result":2},"cert_policy_conflicts_with_street":{"Result":2}} \ No newline at end of file diff --git a/testlint/testDef/domainValDetectsProvince.json b/testlint/testDef/domainValDetectsProvince.json deleted file mode 100644 index 9dfce7bd6..000000000 --- a/testlint/testDef/domainValDetectsProvince.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":2},"cert_policy_conflicts_with_org":{"Result":2},"cert_policy_conflicts_with_postal":{"Result":2},"cert_policy_conflicts_with_province":{"Result":5},"cert_policy_conflicts_with_street":{"Result":2}} \ No newline at end of file diff --git a/testlint/testDef/domainValDetectsStreet.json b/testlint/testDef/domainValDetectsStreet.json deleted file mode 100644 index 4692ce61a..000000000 --- a/testlint/testDef/domainValDetectsStreet.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":2,"Details":""},"cert_policy_conflicts_with_org":{"Result":2,"Details":""},"cert_policy_conflicts_with_postal":{"Result":2,"Details":""},"cert_policy_conflicts_with_province":{"Result":2,"Details":""},"cert_policy_conflicts_with_street":{"Result":5,"Details":""}} \ No newline at end of file diff --git a/testlint/testDef/domainValWorksOnGood.json b/testlint/testDef/domainValWorksOnGood.json deleted file mode 100644 index 8eb5663e0..000000000 --- a/testlint/testDef/domainValWorksOnGood.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_policy_conflicts_with_locality":{"Result":2,"Details":""},"cert_policy_conflicts_with_org":{"Result":2,"Details":""},"cert_policy_conflicts_with_postal":{"Result":2,"Details":""},"cert_policy_conflicts_with_province":{"Result":2,"Details":""},"cert_policy_conflicts_with_street":{"Result":2}} \ No newline at end of file diff --git a/util/testingUtil.go b/util/testingUtil.go deleted file mode 100644 index 4ba97fbe6..000000000 --- a/util/testingUtil.go +++ /dev/null @@ -1,53 +0,0 @@ -package util - -/* - * ZLint Copyright 2020 Regents of the University of Michigan - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy - * of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -// Contains resources necessary to the Unit Test Cases - -import ( - "encoding/pem" - "fmt" - "io/ioutil" - "strings" - - "github.com/zmap/zcrypto/x509" -) - -func ReadCertificate(inPath string) *x509.Certificate { - // All of this can be encapsulated in a function - data, err := ioutil.ReadFile(inPath) - if err != nil { - //read failure, die horribly here - fmt.Println(err) - panic("File read failed!") - } - var textData string = string(data) - if strings.Contains(textData, "-BEGIN CERTIFICATE-") { - block, _ := pem.Decode(data) - if block == nil { - panic("PEM decode failed!") - } - data = block.Bytes - } - theCert, err := x509.ParseCertificate(data) - if err != nil { - //die horribly here - fmt.Println(err) - return nil - } - return theCert -} - -const TestCaseDir = "../../testlint/testCerts/"