mirror of
https://github.com/google/go-attestation.git
synced 2025-06-24 09:11:54 +00:00
attest: fix test build for MacOS (#241)
Windows still requires openssl due to tpm-tools simulator. Will try to figure out that next.
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Link openssl
|
- name: Link openssl
|
||||||
run: sudo ln -s $(brew --prefix openssl)/include/openssl /usr/local/include
|
run: sudo ln -s $(brew --prefix openssl)/include/openssl /usr/local/include
|
||||||
- name: Test
|
- name: Test
|
||||||
run: C_INCLUDE_PATH="$(brew --prefix openssl)/include" LIBRARY_PATH="$(brew --prefix openssl)/lib" go build ./...
|
run: C_INCLUDE_PATH="$(brew --prefix openssl)/include" LIBRARY_PATH="$(brew --prefix openssl)/lib" go test ./...
|
||||||
test-windows:
|
test-windows:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -12,12 +12,10 @@
|
|||||||
// License for the specific language governing permissions and limitations under
|
// License for the specific language governing permissions and limitations under
|
||||||
// the License.
|
// the License.
|
||||||
|
|
||||||
// +build linux
|
|
||||||
// +build !localtest !tpm12
|
// +build !localtest !tpm12
|
||||||
// +build cgo
|
// +build cgo
|
||||||
|
|
||||||
// NOTE: simulator requires cgo, hence the build tag.
|
// NOTE: simulator requires cgo, hence the build tag.
|
||||||
// NOTE: currently requires linuxCmdChannel, which is only defined on Linux.
|
|
||||||
|
|
||||||
package attest
|
package attest
|
||||||
|
|
||||||
@ -35,7 +33,7 @@ func setupSimulatedTPM(t *testing.T) (*simulator.Simulator, *TPM) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &linuxCmdChannel{tpm}})
|
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &fakeCmdChannel{tpm}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user