Files
cocos/pkg/attestation/mocks/verifier.go
T
Sammy Kerata Oina c1cbcec851
CI / lint (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled
COCOS-577 - Introduce Go-based CoRIM generation and deprecate Rust attestation policy scripts. (#578)
* feat: Introduce Go-based CoRIM generation and deprecate Rust attestation policy scripts.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Update dependencies and refactor attestation policy handling

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: Migrate attestation verification to use CoRIM and remove deprecated policy handling and EAT verification tests.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* Removed the `tdx` and `sev-snp` attestation policy scripts and their build configurations, along with related build and installation steps from the main Makefile.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* chore: Remove Rust CI workflow and Cargo Dependabot configuration, and enhance Go test setup for attestation policy paths.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: Use WriteString instead of Write([]byte) for writing policy file content in test.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Refactor `ca-bundle` command to fetch bundles by product string using a configurable HTTP getter with improved error handling, and simplify `attestation_policy` command usage.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* fix: ignore return value of cmd.Help()

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Implement CoRIM generation for Azure and GCP attestation policies and add a CLI command to download and verify GCP OVMF files.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Upgrade Python virtual environment setup to include setuptools and wheel, append computation ID to Docker container names, and improve test robustness with error assertions and conditional skips for runtime tests.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* test: Enhance attestation verification tests, including CoRIM integration and specific platform types like Azure SNP, vTPM, TDX, and IGVM.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Add comprehensive test cases for `VerifyWithCoRIM` including success and measurement mismatch, and refine reference value validation.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Add Azure and TDX attestation verification tests and abstract external service dependencies for improved testability.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* feat: Add new test cases for Azure measurement extraction, EAT platform types, IGVM measurement stopping, vTPM CoRIM verification, and GCP OVMF download CLI.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* test: enhance CLI CoRIM generation and ATLS certificate verification tests, and refactor the Azure MAA client to use an interface.

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

---------

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2026-03-19 17:01:24 +01:00

98 lines
2.5 KiB
Go

// Copyright (c) Ultraviolet
// SPDX-License-Identifier: Apache-2.0
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
mock "github.com/stretchr/testify/mock"
"github.com/veraison/corim/corim"
)
// NewVerifier creates a new instance of Verifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewVerifier(t interface {
mock.TestingT
Cleanup(func())
}) *Verifier {
mock := &Verifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Verifier is an autogenerated mock type for the Verifier type
type Verifier struct {
mock.Mock
}
type Verifier_Expecter struct {
mock *mock.Mock
}
func (_m *Verifier) EXPECT() *Verifier_Expecter {
return &Verifier_Expecter{mock: &_m.Mock}
}
// VerifyWithCoRIM provides a mock function for the type Verifier
func (_mock *Verifier) VerifyWithCoRIM(report []byte, manifest *corim.UnsignedCorim) error {
ret := _mock.Called(report, manifest)
if len(ret) == 0 {
panic("no return value specified for VerifyWithCoRIM")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func([]byte, *corim.UnsignedCorim) error); ok {
r0 = returnFunc(report, manifest)
} else {
r0 = ret.Error(0)
}
return r0
}
// Verifier_VerifyWithCoRIM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyWithCoRIM'
type Verifier_VerifyWithCoRIM_Call struct {
*mock.Call
}
// VerifyWithCoRIM is a helper method to define mock.On call
// - report []byte
// - manifest *corim.UnsignedCorim
func (_e *Verifier_Expecter) VerifyWithCoRIM(report interface{}, manifest interface{}) *Verifier_VerifyWithCoRIM_Call {
return &Verifier_VerifyWithCoRIM_Call{Call: _e.mock.On("VerifyWithCoRIM", report, manifest)}
}
func (_c *Verifier_VerifyWithCoRIM_Call) Run(run func(report []byte, manifest *corim.UnsignedCorim)) *Verifier_VerifyWithCoRIM_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 []byte
if args[0] != nil {
arg0 = args[0].([]byte)
}
var arg1 *corim.UnsignedCorim
if args[1] != nil {
arg1 = args[1].(*corim.UnsignedCorim)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *Verifier_VerifyWithCoRIM_Call) Return(err error) *Verifier_VerifyWithCoRIM_Call {
_c.Call.Return(err)
return _c
}
func (_c *Verifier_VerifyWithCoRIM_Call) RunAndReturn(run func(report []byte, manifest *corim.UnsignedCorim) error) *Verifier_VerifyWithCoRIM_Call {
_c.Call.Return(run)
return _c
}