internal/client: add backward compatibility with images < v0.172.0

The changes to the TestComposeUnsupportedMountPointV0() test case when
the osbuild/images has been updated to v0.172.0 broke the RHEL nightly
and GA CI pipelines.

Change the test to be backward compatible with osbuild/images <
v0.172.0.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-08-08 09:07:48 +02:00 committed by Achilleas Koutsou
parent 78e77ccdd5
commit e3d7a3c8a3

View file

@ -572,6 +572,8 @@ func TestComposeUnsupportedMountPointV0(t *testing.T) {
require.NoError(t, err, "failed with a client error") require.NoError(t, err, "failed with a client error")
require.NotNil(t, resp) require.NotNil(t, resp)
require.Equal(t, "ManifestCreationFailed", resp.Errors[0].ID) require.Equal(t, "ManifestCreationFailed", resp.Errors[0].ID)
require.Contains(t, resp.Errors[0].Msg, "The following custom mountpoints are not supported [\"/etc\"]") // NB: 'path "/etc" is not allowed' is the error message from osbuild/images < v0.172.0 and it is kept for compatibility
// in the nightly and GA CI pipelines. It can be removed once all tested osbuild-composer versions are built with osbuild/images >= v0.172.0.
require.Regexp(t, `(path "/etc" is not allowed)|(The following custom mountpoints are not supported \["/etc"\])`, resp.Errors[0].Msg)
require.Equal(t, 0, len(body)) require.Equal(t, 0, len(body))
} }