cros/faft: Add statically built futility
Some faft tests rely on futility to re-sign firmware images with
dev keys. However, futility is not available in the base container
used on lab servers. Add statically built futility so that these
tests can run on lab servers.
futility in this change was built in the following way:
(In chroot)
cd ~/trunk/src/platform/vboot_reference
(Open Makefile)
(Remove -Wimplicit-fallthrough from COMMON_FLAGS)
(Remove the line "${FUZZ_TEST_BINS}: LDFLAGS += -fsanitize=fuzzer")
rm -rf build && make STATIC=1 futil -j
BUG=chromium:961293, chromium:1003023
TEST=test_that --board=nocturne <IP> suite:fingerprint
TEST=(In chroot) cd ~/trunk/src/third_party/autotest
tar -cvjSf autotest_server_package.tar.bz2 \
--exclude "files/ExternalSource" --exclude "files/site-packages" \
--exclude "files/client" files/
(Copy the resulting tarball to base container's /usr/local
and extract there)
(Copy nocturne_fp_v2.2.191-1d529566e.bin to container's /usr/local)
(In base container) cd /usr/local/files/server/cros/faft
./gen_test_images.sh nocturne_fp \
/usr/local/nocturne_fp_v2.2.191-1d529566e.bin
Change-Id: I75ab466b4f85c8bb96e698d1d48f6691ecd63735
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2006017
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
Tested-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
diff --git a/server/cros/faft/futility b/server/cros/faft/futility
new file mode 100755
index 0000000..479da51
--- /dev/null
+++ b/server/cros/faft/futility
Binary files differ
diff --git a/server/cros/faft/gen_test_images.sh b/server/cros/faft/gen_test_images.sh
index 1565bb6..1a2b079 100755
--- a/server/cros/faft/gen_test_images.sh
+++ b/server/cros/faft/gen_test_images.sh
@@ -10,7 +10,8 @@
BOARD=$1
IMAGE=$(readlink -f $2)
-KEY=$(dirname $(readlink -f $0))/fingerprint_dev_keys/${BOARD}/dev_key.pem
+DIRNAME=$(dirname $(readlink -f $0))
+KEY=${DIRNAME}/fingerprint_dev_keys/${BOARD}/dev_key.pem
# Increment to different rollback versions
ROLLBACK0=00000000
ROLLBACK1=01000000
@@ -23,6 +24,10 @@
# Use original image for some tests.
cp $IMAGE ${BOARD}.bin
+# Use futility included in autotest source no matter if we are in chroot or lxc
+# container, so that it's easier to notice if things break.
+alias futility=${DIRNAME}/futility
+
# Generate dev key set
futility create --desc="${BOARD} dev key" $KEY key