mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
bazel: allow "bazel test" to work without cgo dependencies
This commit is contained in:
parent
de863aece0
commit
1f12541a36
10 changed files with 154 additions and 130 deletions
31
hack/qemu-metadata-api/server/server_cross_test.go
Normal file
31
hack/qemu-metadata-api/server/server_cross_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build !cgo
|
||||
|
||||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package server
|
||||
|
||||
import "github.com/edgelesssys/constellation/v2/hack/qemu-metadata-api/virtwrapper"
|
||||
|
||||
type stubNetwork struct {
|
||||
leases []virtwrapper.NetworkDHCPLease
|
||||
getLeaseErr error
|
||||
}
|
||||
|
||||
func newStubNetwork(leases []virtwrapper.NetworkDHCPLease, getLeaseErr error) stubNetwork {
|
||||
return stubNetwork{
|
||||
leases: leases,
|
||||
getLeaseErr: getLeaseErr,
|
||||
}
|
||||
}
|
||||
|
||||
func (n stubNetwork) GetDHCPLeases() ([]virtwrapper.NetworkDHCPLease, error) {
|
||||
return n.leases, n.getLeaseErr
|
||||
}
|
||||
|
||||
func (n stubNetwork) Free() error {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue