MCPcopy Create free account
hub / github.com/conforma/cli / TestValidateVSAInput_EdgeCases

Function TestValidateVSAInput_EdgeCases

cmd/validate/vsa_test.go:558–662  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

556}
557
558func TestValidateVSAInput_EdgeCases(t *testing.T) {
559 tests := []struct {
560 name string
561 data *validateVSAData
562 args []string
563 expectError bool
564 errorMsg string
565 }{
566 {
567 name: "signature verification enabled without public key",
568 data: &validateVSAData{
569 vsaIdentifier: "sha256:abc123",
570 images: "",
571 vsaExpirationStr: "24h",
572 ignoreSignatureVerification: false,
573 publicKeyPath: "",
574 },
575 args: []string{},
576 expectError: true,
577 errorMsg: "--vsa-public-key is required for signature verification",
578 },
579 {
580 name: "signature verification disabled with public key",
581 data: &validateVSAData{
582 vsaIdentifier: "sha256:abc123",
583 images: "",
584 vsaExpirationStr: "24h",
585 ignoreSignatureVerification: true,
586 publicKeyPath: "/path/to/key.pub",
587 },
588 args: []string{},
589 expectError: false,
590 },
591 {
592 name: "signature verification enabled with public key",
593 data: &validateVSAData{
594 vsaIdentifier: "sha256:abc123",
595 images: "",
596 vsaExpirationStr: "24h",
597 ignoreSignatureVerification: false,
598 publicKeyPath: "/path/to/key.pub",
599 },
600 args: []string{},
601 expectError: false,
602 },
603 {
604 name: "args override vsa flag",
605 data: &validateVSAData{
606 vsaIdentifier: "sha256:old123",
607 images: "",
608 vsaExpirationStr: "24h",
609 ignoreSignatureVerification: true,
610 },
611 args: []string{"sha256:new123"},
612 expectError: false,
613 },
614 {
615 name: "empty args with empty vsa flag",

Callers

nothing calls this directly

Calls 3

validateVSAInputFunction · 0.85
RunMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected