Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the type used for 'partition' elements #650

Merged
merged 2 commits into from
Jul 14, 2020
Merged

Conversation

dgdavid
Copy link
Member

@dgdavid dgdavid commented Jul 14, 2020

Problem

As reported in https://bugzilla.suse.com/show_bug.cgi?id=1174071, the AutoYaST profile validation started failing with ERROR: Element profile failed to validate content.

Click to show/hide an screenshot

validation_failed

This happens because partition elements in the autoinst.xml profile have the t="map" attribute but it is currently missing in the schema.

Maybe related to #598

Solution

To update the partitioning.rnc file, setting the MAP type to the partition element.

Tests

During the installation, via driver update

  • Build both packages, yast-autoinstallation and yast-schema using the --keep-pkgs and --prefer-pkgs osc options

    rake "osc:build[-p /tmp/pkgs -k /tmp/pkgs]"

  • Create a driver update

  • Run the installation using the driver udpate and AutoYaST profile

The profile validations works fine and the auto installation could continue

Click to show/hide an screenshot

Screenshot_openSUSE-Leap_2020-07-14_14:22:33

Manually, runing the xmllint validation locally

I have tested this change manually, as described bellow

  • Run the installation with the provided AutoYaST profile.

  • Copy the `/tmp/YaST2-temporary-directory/autoinst.xml file to a local machine

  • Execute the validation locally

    $ xmllint --noout --relaxng /usr/share/YaST2/schema/autoyast/rng/profile.rng autoinst.xml

    Relax-NG validity error : Extra element partitioning in interleave
    autoinst.xml:19: element partitioning: Relax-NG validity error : Element profile failed to validate content
    autoinst.xml fails to validate

  • Apply suggested changes, build the package and re-install it using the new rpm file

  • Re-build the yast2-schema manually

    $ cd /path/to/yast2-schema-source-code
    $ sudo zypper in trang
    $ make -f Makefile.cvs
    $ make
    $ sudo make install

  • Check that /usr/share/YaST2/schema/autoyast/rng/partitioning.rng has changed

    ...
    <define name="partition">
    <element name="partition">
    <ref name="MAP"/>
    ...

  • Execute the validation again

    $ xmllint --noout --relaxng /usr/share/YaST2/schema/autoyast/rng/profile.rng autoinst.xml

    autoinst.xml validates

@coveralls
Copy link

Coverage Status

Coverage remained the same at 48.285% when pulling bb09e59 on fix-partition-type into 320639d on master.

@dgdavid dgdavid marked this pull request as ready for review July 14, 2020 12:48
@dgdavid dgdavid merged commit 58f204a into master Jul 14, 2020
@dgdavid dgdavid deleted the fix-partition-type branch July 14, 2020 13:28
@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #107 successfully finished
✔️ Created OBS submit request #820900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants