From f6ef8c9d1dbba2449eec47d79ae047c30476dff2 Mon Sep 17 00:00:00 2001 From: Kris Alder Date: Wed, 22 Feb 2023 10:20:49 -0800 Subject: pkg/build: add build code for Android devices Booting physical Android devices requires building a few artifacts, as described at https://source.android.com/docs/setup/build/building-kernels. When a ProxyVM type is used, we need to differentiate whether or not to use the Android build logic, so we add an additional mapping which uses a different name but the same VM logic. --- vm/vm_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vm/vm_test.go') diff --git a/vm/vm_test.go b/vm/vm_test.go index d3429f5f7..9c190cf50 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -397,3 +397,19 @@ func testMonitorExecution(t *testing.T, test *Test) { t.Fatalf("want output:\n%s\n\ngot output:\n%s\n", test.Report.Output, rep.Output) } } + +func TestVMType(t *testing.T) { + testCases := []struct { + in string + want string + }{ + {"gvisor", "gvisor"}, + {"proxyapp:android", "proxyapp"}, + } + + for _, tc := range testCases { + if got := vmType(tc.in); got != tc.want { + t.Errorf("vmType(%q) = %q, want %q", tc.in, got, tc.want) + } + } +} -- cgit mrf-deployment