Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-38125

[QE] Fix issues with registration in robottelo

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • Registration
    • sat-proton
    • 2
    • False
    • Proton Sprint 3
    • None

      Description of problem:

      It appears that this change
      https://github.com/theforeman/foreman/pull/10555

      https://projects.theforeman.org/issues/38458
      (slack thread for this change)

      made our automation start failing in our usual registration procedure.

      Registration component failures

      Facts component failures also affected by this issue

      TFA analyzer (search for "There are no enabled repositories in")

       

      The issue is that in several tests, we register the host via the generated registration command, which was previously passing and had RC:0.

      Now it still registers the host but fails with RC:1.

      The registration command also says

       Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".

       

      This message appeared previously, but the command was not failing with RC:1.

      Our test suite is affected by this RC change as we assert that the registration passed via:
      assert result.status == 0, f'Failed to register host: {result.stderr}'
       

      More info from the investigation:

      • When there is some repository synced to the environment the RC is no longer 0, which is expected as the error message states that.
      • Issue started appearing since stream 122
      • What affects the behavior here is "Setup Red Hat Lightspeed" setting in the AK generation
      • In snap 121 when this was set to "Yes" registration passed with RC:0 even when it said {{There are no enabled repositories }}since snap 122 it fails with RC:1
      • The script that is aquired via the registration command has this added at the end of that script since stream 122
      # Update / create the host record in Foreman and fetch the host initial configuration script
      register_katello_host
      register_katello_host | bash
      curl_status=$?
      if [ $curl_status -ne 0 ]; then
        echo "Failed to fetch the host initialization script."
        echo "Please see the logs for more information."
        cleanup_and_exit $curl_status
      fi
      bash /root/registration_host_init.sh
      init_conf_status=$?
      if [ $init_conf_status -ne 0 ]; then
        echo "Host initialization script failed, see the logs for more information."
        echo "You can access the script source by running 'cat /root/registration_host_init.sh'"
        cleanup_and_exit $init_conf_status
      fi 

       

      Acceptance criteria:

      Registration is passing in the robottelo.

       

              rhn-engineering-lvasina Ladislav Vasina
              rhn-engineering-lvasina Ladislav Vasina
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: