Editing
C&I Wiki Portal/ToolsDevelopmentGuideline
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== Meta-Jobs ===== There are also things we refer to as "Metajobs". These jobs are actually run early on and are simply used to generate jobs on the fly. In general, you would use a metajob to create separate jobs for multiple pieces of the same hardware. In the following example, we have a metajob that creates a separate storage test for any disk device (NON-USB) discovered. <pre> plugin: local name: disk/ocp/io_stress requires: device.category == 'DISK' package.name == 'stressapptest' _description: Verify that storage devices, such as Fibre Channel and RAID can be detected and perform under stress. command: cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"' plugin: shell name: disk/ocp/io_stress_`ls /sys$path/block` user: root requires: device.path == "$path" block_device.`ls /sys$path/block`_state != 'removable' description: Disk I/O stress test for $product command: disk_stress `ls /sys$path/block | sed 's|!|/|'` EOF </pre> Note the differences between a Metajob and a normal Job. ;Plugin :'''local''' is a special plugin that tells Checkbox to run this job as soon as the tool starts. This means this job is executed well before the user ever sees a Suite or Test Selection screen. ;requires :This job also introduces the '''requires''' directive. This means that the following conditions must be met before the job will be run. :Also note that you can specify multiple requirements by placing each one on a new line with a single-space indention. ;Command :In the basic example, I mentioned that a '''Command''' can be embedded shell code. This is an example of that embedded shell code. This runs the shell code that follows. In this example, it cats all the text between the 'cat' line and the 'EOF' marker (which looks exactly like the Basic Job Description) and pipes all that through the 'run-templates' helper tool which creates on-the-fly jobs. In this case, 'run-templates' also executes the udev-resource resource gathering script and ensures that child jobs are ONLY created for hardware devices that fit into the DISK category (so we don't create these Disk jobs for network devices or CPUs).
Summary:
Please note that all contributions to OpenCompute may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
OpenCompute:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information