Assets cached before the stamp files were introduced have no
corresponding .stamp file. The script already copes with that when
reading the timestamp, by assuming the QEMU v10.1 release date, which
makes such assets eligible for removal.
However, since commit c1bb594fe4, removing the asset also
unconditionally unlinks its .stamp file. For these old entries that
file does not exist, so unlink() raises FileNotFoundError and the
script aborts after deleting the first such asset, leaving the rest of
the cache uncleaned and returning an error.
Pass missing_ok=True so that a missing .stamp file is not an error.
Fixes: c1bb594fe4 ("scripts/clean_functional_cache: Remove also .stamp files")
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
The cache cleanup script already successfully removes the assets
that are unused since more than 6 months, but it forgot to delete
the corresponding timestamp files, too.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260814122643.312129-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <th.huth@posteo.eu>
The download cache of the functional tests is currently only growing.
But sometimes tests get removed or changed to use different assets,
thus we should clean up the stale old assets after a while when they
are not in use anymore. So add a script that looks at the time stamps
of the assets and removes them if they haven't been touched for more
than half of a year. Since there might also be some assets around that
have been added to the cache before we added the time stamp files,
assume a default time stamp that is close to the creation date of this
patch, so that we don't delete these files too early (so we still have
all assets around in case we have to bisect an issue in the recent past
of QEMU).
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251014083424.103202-3-thuth@redhat.com>