teuthology/packaging.py: fix build_complete: search for requested arch
The workaround from https://github.com/ceph/teuthology/pull/1649 was
necessary because my original algorithm was faulty: when searching
through all the builds for a ref/sha1, one must match the arch
requested by the call to build_complete (in the Builder object);
that arch's presence in the shaman api/search result is not enough
of a match, as it can contain multiple arches in multiple states
of build success. Only a failure *on the requested arch* should be
considered a "requested build not complete".
(note: this will still currently fail a request for a build whose
repo is complete but container build failed, as "build complete"
currently conflates those two statuses. Teuthology does not
contain the information whether a build is being requested for
packages, containers, or both.)
Also add testing for build_complete().
Fixes: https://tracker.ceph.com/issues/53205 Signed-off-by: Dan Mick <dmick@redhat.com>