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
2 changed files with 2 additions and 4 deletions

View File

@ -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:

View File

@ -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)
} }