pulp/pulp-smash

As a User I would like to sync SUSE errata

werwty opened this issue · 2 comments

https://pulp.plan.io/issues/3377

Testing with actual SUSE repo:

Note: Syncing from an actual SUSE repo makes sure that errata data gets pulled down with query_auth_token

  1. Register for SUSE developer subscription at https://www.suse.com/subscriptions/sles/developer/
  2. Get SUSE repo info using the developer subscrption token with jmitsch's script: https://gist.github.com/johnpmitsch/0297e7b0c6ac7e261dbfd559d4903133
  3. Get the token for https://updates.suse.com/SUSE/Updates/SLE-SERVER/12-SP3/x86_64/update/
  4. Create a repo: pulp-admin rpm repo create --repo-id suse-updates --feed=https://updates.suse.com/SUSE/Updates/SLE-SERVER/12-SP3/x86_64/update/
  5. update token on the repo http --auth admin:admin --json PUT https://pulp2/pulp/api/v2/repositories/suse-updates/ importer_config:='{"query_auth_token": "YOURTOKEN"}'
  6. sync the repo: pulp-admin rpm repo sync run --repo-id=suse-updates

Things to look for in the published /var/lib/pulp/published/..../repodata/updateinfo.xml:

  • A package with restart_suggested
  • A package with relogin_suggested

Creating a Fixture

To simplify these test I would recommend creating a suse errata fixture. Here is an sample SUSE updateinfo.xml:

<?xml version="1.0"?>
<updates>
<update from="maint-coord@suse.de" status="stable" type="security" version="1">
  <id>RHEA-2012:0055</id>
  <title>Sea_Erratum</title>
  <release>1</release>
  <issued date="1504532312"/>

  <description>Sea_Erratum- should not update because version is the same</description>
  <pkglist>
    <collection short="">
      <name>1</name>
      <package arch="noarch" name="walrus" release="1" src="http://www.fedoraproject.org" version="5.21">
        <filename>walrus-5.21-1.noarch.rpm</filename>
      </package>
      <package arch="noarch" name="penguin" release="1" src="http://www.fedoraproject.org" version="0.9.1">
        <filename>penguin-0.9.1-1.noarch.rpm</filename>
      </package>
      <package arch="noarch" name="shark" release="1" src="http://www.fedoraproject.org" version="0.1">
        <filename>shark-0.1-1.noarch.rpm</filename>
	<restart_suggested>True</restart_suggested>
      </package>
    </collection>
  </pkglist>
</update>

<update from="maint-coord@suse.de" status="stable" type="security" version="4">
  <id>RHEA-2012:0056</id>
  <title>Bird_Erratum</title>
  <release>1</release>
  <issued date="1504532312"/>
  <description>Updated Bird_Erratum</description>
  <pkglist>
    <collection short="">
      <name>1</name>
      <package arch="noarch" name="crow" release="1" src="http://www.fedoraproject.org" version="0.8">
        <filename>crow-0.8-1.noarch.rpm</filename>
	<restart_suggested>True</restart_suggested>
	<relogin_suggested>1</relogin_suggested>
      </package>
      <package arch="noarch" name="stork" release="2" src="http://www.fedoraproject.org" version="0.12">
        <filename>stork-0.12-2.noarch.rpm</filename>
	<restart_suggested>False</restart_suggested>
      </package>
      <package arch="noarch" name="duck" release="1" src="http://www.fedoraproject.org" version="0.6">
        <filename>duck-0.6-1.noarch.rpm</filename>
      </package>
    </collection>
  </pkglist>
</update>

</updates>

It has the following differences from a yum/dnf updateinfo.xml:

  • No <updated date=""/> timestamp for updated Errata
  • Different datetime format for <issued date=""> timestamp
  • <update version=""> is incremented for updated Errata
  • some packages have a restart_suggested field
  • some packages have a relogin_suggested field

@Ichimonji10 Let's add this one to the intern project.

An additional note, SUSE has srpm packages in errata. Currently we don't publish these, so the pulp published updateinfo.xml files would not contain these packages. There is an issue filed to fix this: https://pulp.plan.io/issues/3460