Bug 1284393 - RELAX NG validation error when job XML has <hostRequires/> with force="" attribute and child elements
Summary: RELAX NG validation error when job XML has <hostRequires/> with force="" attr...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: beaker-dev-list
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-23 08:48 UTC by Jan Stancek
Modified: 2015-11-24 04:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-24 04:26:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan Stancek 2015-11-23 08:48:58 UTC
Description of problem:
When I clone recipe with following hostrequires:

<hostRequires force="dell-per820-02.khw.lab.eng.bos.redhat.com">
  <and>
    <arch op="=" value="x86_64"/>
    <cpu_count op="&gt;" value="1"/>
    <hypervisor op="=" value=""/>
  </and>
  <system_type value="Machine"/>
</hostRequires>

Beaker complains with this error message:

Job failed schema validation. Please confirm that you want to submit it.
    Line 21, col 0: Invalid attribute force for element hostRequires
    Line 6, col 0: Invalid sequence in interleave
    Line 6, col 0: Element recipe failed to validate content
    Line 5, col 0: Element recipeSet failed to validate content

but according to beaker-job.rng "force" attribute should be allowed:
      <element name="hostRequires">
        <a:documentation xml:lang="en">
          This element is a container for expressing constraints on the
          system which will be selected to run this recipe.
        </a:documentation>
        <choice>
          <attribute name="force">
            <data type="string"/>
            <a:documentation xml:lang="en">
            Select a specific system by FQDN. This bypasses the
            normal filtering mechanisms for selecting a system,
            and always uses the named system regardless of its
            current condition. No other filter criteria can be
            specified when this attribute is used.
            </a:documentation>
          </attribute>

Version-Release number of selected component (if applicable):
21.2

How reproducible:
always

Steps to Reproduce:
1. try to clone recipe with hostrequires that has "force" attribute

Actual results:
Beaker validation error

Expected results:
clone should work without errors

Additional info:

Comment 1 Dan Callaghan 2015-11-24 04:24:53 UTC
The RELAX NG schema is written to only allow normal <hostRequires>...</hostRequires> *or* <hostRequires force=""/> with no child elements.

So what it's trying to warn you about here is the fact that you have <hostRequires force="">...</hostRequires> with both force="" attribute *and* child elements. The child elements have no effect when force="" is given.

The fact that the RELAX NG validation error is completely inscrutable and gives no hint about the real error, is an old known issue: bug 689338. We can't easily fix that because it comes from libxml2.

Comment 2 Dan Callaghan 2015-11-24 04:26:36 UTC
I guess this is either NOTABUG or dupe of 689338 depending on your point of view.


Note You need to log in before you can comment on or make changes to this bug.