new_variant: update the end-to-end test for dedede

dedede's gen_fit_image.sh moves the generated blobs to their final
place, so have the end-to-end test place the fake fitimages in the
correct place for commit_fitimage.sh to find them. This also
requires an update to new_variant to know where to look for the
fitimages in check_fit_image_files, and that rippled to all of
the reference boards that use fitimages.

BUG=b:173824076
TEST=`testdata/new_variant_fulltest.sh waddldee && echo PASS`

Cq-Depend: chrome-internal:3421249
Change-Id: I0c1517127cea0de0cd8ba81910d27247824ba3c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2553348
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
diff --git a/contrib/variant/ambassador.py b/contrib/variant/ambassador.py
index 7cb4cab..04e376d 100644
--- a/contrib/variant/ambassador.py
+++ b/contrib/variant/ambassador.py
@@ -53,6 +53,9 @@
 # Ambassador firmware is comingled with Puff's, so fitimage goes there.
 fitimage_dir = 'private-overlays/baseboard-puff-private/sys-boot/coreboot-private-files-puff'
 
+# Directory under fitimage_dir where gen_fit_image.sh leaves its outputs
+fitimage_outputs_dir = 'asset_generation/outputs'
+
 # Explanation of gen_fit_image command
 fitimage_cmd = './gen_fit_image.sh %s <path_to_fit_kit> -b'
 
diff --git a/contrib/variant/hatch.py b/contrib/variant/hatch.py
index 3802701..80a6203 100644
--- a/contrib/variant/hatch.py
+++ b/contrib/variant/hatch.py
@@ -47,6 +47,9 @@
 fitimage_dir = ('private-overlays/baseboard-hatch-private/'
     'sys-boot/coreboot-private-files-hatch')
 
+# Directory under fitimage_dir where gen_fit_image.sh leaves its outputs
+fitimage_outputs_dir = 'asset_generation/outputs'
+
 # Explanation of gen_fit_image command
 fitimage_cmd = './gen_fit_image.sh %s <path_to_fit_kit> -b'
 
diff --git a/contrib/variant/new_variant.py b/contrib/variant/new_variant.py
index 8553027..a0ca218 100755
--- a/contrib/variant/new_variant.py
+++ b/contrib/variant/new_variant.py
@@ -241,6 +241,8 @@
     * fitimage_pkg - package name for the fitimage
     * fitimage_dir - directory for fitimage; prepend '/mnt/host/source/src/'
         in chroot, prepend '~/chromiumos/src' outside the chroot
+    * fitimage_outputs_dir - directory under fitimage_dir where gen_fit_image.sh
+        leaves its outputs
     * workon_pkgs - list of packages to cros_workon
     * emerge_cmd - the emerge command, e.g. 'emerge-hatch'
     * emerge_pkgs - list of packages to emerge
@@ -353,6 +355,7 @@
     status.emerge_cmd           = module.emerge_cmd
     status.emerge_pkgs          = module.emerge_pkgs
     status.fitimage_dir         = getattr(module, 'fitimage_dir', None)
+    status.fitimage_outputs_dir = getattr(module, 'fitimage_outputs_dir', None)
     status.fitimage_pkg         = getattr(module, 'fitimage_pkg', None)
     status.fitimage_cmd         = getattr(module, 'fitimage_cmd', None)
     status.fsp                  = getattr(module, 'fsp', None)
@@ -870,7 +873,7 @@
         all files are present.
     """
     outputs_dir = os.path.join('/mnt/host/source/src', status.fitimage_dir,
-        'asset_generation/outputs')
+        status.fitimage_outputs_dir)
     logging.debug('outputs_dir = "%s"', outputs_dir)
 
     files_not_found = []
diff --git a/contrib/variant/puff.py b/contrib/variant/puff.py
index 84b1eca..8069266 100644
--- a/contrib/variant/puff.py
+++ b/contrib/variant/puff.py
@@ -49,6 +49,9 @@
 # Directory for fitimage; append '~/trunk/src/'' in chroot, '~/chromiumos/src' outside
 fitimage_dir = 'private-overlays/baseboard-puff-private/sys-boot/coreboot-private-files-puff'
 
+# Directory under fitimage_dir where gen_fit_image.sh leaves its outputs
+fitimage_outputs_dir = 'asset_generation/outputs'
+
 # Explanation of gen_fit_image command
 fitimage_cmd = './gen_fit_image.sh %s <path_to_fit_kit> -b'
 
diff --git a/contrib/variant/testdata/new_variant_fulltest.sh b/contrib/variant/testdata/new_variant_fulltest.sh
index 1f3a581..c5a10b8 100755
--- a/contrib/variant/testdata/new_variant_fulltest.sh
+++ b/contrib/variant/testdata/new_variant_fulltest.sh
@@ -94,7 +94,11 @@
     OVERLAY_DIR=/mnt/host/source/src/private-overlays/overlay-dedede-private/chromeos-base/chromeos-config-bsp-dedede-private
     EBUILD=chromeos-config-bsp-dedede-private-9999.ebuild
     FITIMAGE=drawcia
-    FITIMAGE_OUTPUTS_DIR=/mnt/host/source/src/private-overlays/baseboard-dedede-private/sys-boot/coreboot-private-files-baseboard-dedede/asset_generation/outputs
+    # FITIMAGE_OUTPUTS_DIR and FITIMAGE_FILES_DIR are supposed to be the same;
+    # gen_fit_image.sh moves the generated files from asset_generation/outputs
+    # to files/blobs, so we have to put our fake fitimage files in files/blobs
+    # for commit_fitimage.sh to find there.
+    FITIMAGE_OUTPUTS_DIR=/mnt/host/source/src/private-overlays/baseboard-dedede-private/sys-boot/coreboot-private-files-baseboard-dedede/files/blobs
     FITIMAGE_FILES_DIR=/mnt/host/source/src/private-overlays/baseboard-dedede-private/sys-boot/coreboot-private-files-baseboard-dedede/files/blobs
     ;;
 
diff --git a/contrib/variant/volteer.py b/contrib/variant/volteer.py
index 4b7d116..96ec7cc 100644
--- a/contrib/variant/volteer.py
+++ b/contrib/variant/volteer.py
@@ -46,6 +46,9 @@
 fitimage_dir = 'private-overlays/baseboard-volteer-private/sys-boot/'\
     'coreboot-private-files-baseboard-volteer'
 
+# Directory under fitimage_dir where gen_fit_image.sh leaves its outputs
+fitimage_outputs_dir = 'asset_generation/outputs'
+
 # Explanation of gen_fit_image command
 fitimage_cmd = './gen_fit_image.sh %s <path_to_fit_kit> -b'
 
diff --git a/contrib/variant/waddledee.py b/contrib/variant/waddledee.py
index 9022467..557d801 100644
--- a/contrib/variant/waddledee.py
+++ b/contrib/variant/waddledee.py
@@ -46,6 +46,9 @@
 fitimage_dir = 'private-overlays/baseboard-dedede-private/sys-boot/'\
     'coreboot-private-files-baseboard-dedede'
 
+# Directory under fitimage_dir where gen_fit_image.sh leaves its outputs
+fitimage_outputs_dir = 'files/blobs'
+
 # Explanation of gen_fit_image command
 fitimage_cmd = './gen_fit_image.sh %s <path_to_fit_kit> -b'