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:
Eric Chiang 2021-09-01 13:24:57 -07:00 committed by GitHub
parent 505680f536
commit a35bd36e42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -49,7 +49,7 @@ jobs:
- name: Link openssl
run: sudo ln -s $(brew --prefix openssl)/include/openssl /usr/local/include
- 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:
strategy:
matrix:

View File

@ -12,12 +12,10 @@
// License for the specific language governing permissions and limitations under
// the License.
// +build linux
// +build !localtest !tpm12
// +build cgo
// NOTE: simulator requires cgo, hence the build tag.
// NOTE: currently requires linuxCmdChannel, which is only defined on Linux.
package attest
@ -35,7 +33,7 @@ func setupSimulatedTPM(t *testing.T) (*simulator.Simulator, *TPM) {
if err != nil {
t.Fatal(err)
}
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &linuxCmdChannel{tpm}})
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &fakeCmdChannel{tpm}})
if err != nil {
t.Fatal(err)
}