Bug 1308643 - [Beaker 22.1][RFE restraint] xslt template to strip beaker jobs to create a valid restraint xml
Summary: [Beaker 22.1][RFE restraint] xslt template to strip beaker jobs to create a v...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Restraint
Classification: Retired
Component: general
Version: 0.1.23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.1.24
Assignee: Artem Savkov
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-15 16:44 UTC by PaulB
Modified: 2016-04-21 00:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-18 19:57:14 UTC


Attachments (Terms of Use)

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/


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