Index: client/common_lib/cartesian_config.py |
diff --git a/client/tests/kvm/kvm_config.py b/client/common_lib/cartesian_config.py |
old mode 100755 |
new mode 100644 |
similarity index 96% |
rename from client/tests/kvm/kvm_config.py |
rename to client/common_lib/cartesian_config.py |
index 4dbb1d49b508643dc7935dbc6ed988f811725b6c..ac04c24c3cec8f742a04835c2a3b69ffa951603f |
--- a/client/tests/kvm/kvm_config.py |
+++ b/client/common_lib/cartesian_config.py |
@@ -1,37 +1,35 @@ |
#!/usr/bin/python |
""" |
-KVM test configuration file parser |
+Cartesian configuration format file parser. |
+ |
+ Filter syntax: |
+ , means OR |
+ .. means AND |
+ . means IMMEDIATELY-FOLLOWED-BY |
+ |
+ Example: |
+ qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide |
+ means match all dicts whose names have: |
+ (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR |
+ ((RHEL IMMEDIATELY-FOLLOWED-BY 6) AND raw AND boot) OR |
+ (smp2 AND qcow2 AND migrate AND ide) |
+ |
+ Note: |
+ 'qcow2..Fedora.14' is equivalent to 'Fedora.14..qcow2'. |
+ 'qcow2..Fedora.14' is not equivalent to 'qcow2..14.Fedora'. |
+ 'ide, scsi' is equivalent to 'scsi, ide'. |
+ |
+ Filters can be used in 3 ways: |
+ only <filter> |
+ no <filter> |
+ <filter>: |
+ The last one starts a conditional block. |
@copyright: Red Hat 2008-2011 |
""" |
import re, os, sys, optparse, collections |
- |
-# Filter syntax: |
-# , means OR |
-# .. means AND |
-# . means IMMEDIATELY-FOLLOWED-BY |
- |
-# Example: |
-# qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide |
-# means match all dicts whose names have: |
-# (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR |
-# ((RHEL IMMEDIATELY-FOLLOWED-BY 6) AND raw AND boot) OR |
-# (smp2 AND qcow2 AND migrate AND ide) |
- |
-# Note: |
-# 'qcow2..Fedora.14' is equivalent to 'Fedora.14..qcow2'. |
-# 'qcow2..Fedora.14' is not equivalent to 'qcow2..14.Fedora'. |
-# 'ide, scsi' is equivalent to 'scsi, ide'. |
- |
-# Filters can be used in 3 ways: |
-# only <filter> |
-# no <filter> |
-# <filter>: |
-# The last one starts a conditional block. |
- |
- |
class ParserError: |
def __init__(self, msg, line=None, filename=None, linenum=None): |
self.msg = msg |
@@ -190,11 +188,11 @@ class NegativeCondition(OnlyFilter): |
class Parser(object): |
""" |
- Parse an input file or string that follows the KVM Test Config File format |
+ Parse an input file or string that follows the Cartesian Config File format |
and generate a list of dicts that will be later used as configuration |
- parameters by the KVM tests. |
+ parameters by autotest tests that use that format. |
- @see: http://www.linux-kvm.org/page/KVM-Autotest/Test_Config_File |
+ @see: http://autotest.kernel.org/wiki/CartesianConfig |
""" |
def __init__(self, filename=None, debug=False): |