Bug 1308643

Summary: [Beaker 22.1][RFE restraint] xslt template to strip beaker jobs to create a valid restraint xml
Product: [Retired] Restraint Reporter: PaulB <pbunyan>
Component: generalAssignee: Artem Savkov <asavkov>
Status: CLOSED NEXTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.1.23CC: asavkov, bpeck, dcallagh, dzickus, jburke, mjia, pbunyan, rjoost
Target Milestone: 0.1.24Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-18 19:57:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description PaulB 2016-02-15 16:44:12 UTC
Description of problem:
 Previously one could export a Beaker xml and use the "unmodified xml" to run
testing on a remote host using restraint. The restraint command now fails if the xml contains elements or attributes that are not listed in 
usr/share/restraint/client/job_schema.rng.

Version-Release number of selected component (if applicable):
Beaker: 22.1
restraint: 0.1.23-2.el6eso.x86_64

Actual results:
The restraint command now fails if xml contains elements or attributes that are not listed in usr/share/restraint/client/job_schema.rng.

I see that the following restraint option now exists:
  -n, --novalidate (Do not perform xml validation)

Expected results:
Can you include an xslt template to strip beaker jobs to create a valid 
restraint xml.

Additional info:

Comment 1 PaulB 2016-02-15 16:48:43 UTC
All,
Somebody moved the cheese ;)

[pbunyan@Desktop]$ cat restraint_cheese 
[root@Remote~]# restraint --help
Usage:
  restraint [OPTION...]

Test harness for Beaker. Runs tasks according to a job 
and collects their results.

Help Options:
  -h, --help                                                     
Show help options

Application Options:
  -6, --ipv6                                                     Use IPV6 for communication
  -p, --port=PORT                                                Specify the port to listen on
  -j, --job=FILE                                                 Run job from file
  -r, --run=DIR                                                  Continue interrupted job from DIR
  -n, --novalidate                                               Do not perform xml validation
  -t, --host=<recipe_id>=[<user>@]<host>[:<port>][/ssh_port]     Set host for a recipe with specific id.
  -v, --verbose                                                  Increase verbosity, up to three times.

[root@Remote ~]# 

[root@Remote xmls]# rpm -ql restraint-client
/usr/bin/restraint
/usr/share/restraint/client/bootstrap/LICENSE
/usr/share/restraint/client/bootstrap/README
/usr/share/restraint/client/bootstrap/bootstrap.min.css
/usr/share/restraint/client/job2html.xml
/usr/share/restraint/client/job2junit.xml
/usr/share/restraint/client/job_schema.rng
[root@Remote xmls]# 

[root@Remote xmls]# cat /usr/share/restraint/client/job_schema.rng
<element name="job" xmlns="http://relaxng.org/ns/structure/1.0">
  <oneOrMore>
    <element name="recipeSet">
      <oneOrMore>
        <element name="recipe">
          <optional>
            <attribute name="id"/>
          </optional>
          <optional>
            <attribute name="whiteboard"/>
          </optional>
          <optional>
            <attribute name="role"/>
          </optional>
          <oneOrMore>
            <element name="task">
              <optional>
                <attribute name="name"/>
              </optional>
              <optional>
                <attribute name="role"/>
              </optional>
              <interleave>
                <optional>
                  <element name="params">
                    <zeroOrMore>
                      <element name="param">
                        <group>
                          <attribute name="name"/>
                          <attribute name="value"/>
                        </group>
                      </element>
                    </zeroOrMore>
                  </element>
                </optional>
                <choice>
                  <element name="rpm">
                    <attribute name="name"/>
                    <attribute name="path"/>
                  </element>
                  <element name="fetch">
                    <attribute name="url"/>
                  </element>
                </choice>
              </interleave>
            </element>
          </oneOrMore>
        </element>
      </oneOrMore>
    </element>
  </oneOrMore>
</element>
[root@Remote xmls]#
[pbunyan@Desktop]$ 


Best,
-pbunyan

Comment 2 Artem Savkov 2016-02-16 16:37:53 UTC
https://gerrit.beaker-project.org/#/c/4688/