#411 release: find way to inspect created artifacts to make sure they have correct ostree version
Opened 2 years ago by dustymabe. Modified 2 years ago

As part of a FAH release we go through each architecture to make sure that the qcow that was created has the same ostree version # across them all. This is to prevent us from doing a release with artifacts that have mismatched ostree versions. It would be nice for us to automate this discovery so we don't have to do it by hand.

Some options are:

  • leverage our test systems to report ostree version/commit in the results
  • somehow get pungi/koji/imagefactory to report the ostree version/commit that was used when creating the image (might be able to do this with icicle)
  • pull down the images with some script and use guestfish/libguestfs to verify.

Just leaving this guestfish one-liner I came up with for future reference (both mine and whoever tackles this ticket):

$ guestfish -- add Fedora-Atomic-27-20171101.0.x86_64.qcow2 : run : -mount /dev/atomicos/root / : cat /ostree/deploy/fedora-atomic/deploy/908188b741a44050cf4ec56ef63cbf6e1c8f0efc489195095d4d959f136eda8e.0/usr/lib/os.release.d/os-release-fedora | grep OSTREE_VERSION

Python method version I'm testing:

    def get_ostree_version(self):
            g = guestfs.GuestFS(python_return_dict=True)
            g.add_drive_opts(self._image_path, format="qcow2", readonly=0)
            g.mount('/dev/atomicos/root', '/')
            dir = g.ls('/ostree/deploy/fedora-atomic/deploy/')[0]
            data = g.cat(
            version = re.findall("OSTREE_VERSION=(.*)", data)[0]
            return version
        except Exception as ex:
            raise Exception(
                'Unable to read ostree version: {}: {}'.format(type(ex), ex))

Metadata Update from @dustymabe:
- Issue tagged with: host

2 years ago

Login to comment on this ticket.