# # - uses a module (platform23) maintained by Marc-Andre Lemburg and distributed in Python versions >= 2.3 # from IntAttr import * from Base import * import StringAttr,Platform import resource,platform23 class SystemWordSize(StringAttr.StringEQ): type = 'system word size in bits' title = 'System Word Size in Bits' action = 'test system word size in bits' def val(self): return platform23.architecture()[0][:2] class CPU(StringAttr.StringEQ): type = 'system processor' title = 'System Processor' action = 'test system processor' def val(self): # Swapped from platform23.machine to allow for pretend-arch (Scot Kronenfeld 2/2009) return Platform.thisArch() class ByteOrder(StringAttr.StringEQ): type = 'system byte order' title = 'System Byte Order' action = 'test system byte order' def val(self): return sys.byteorder class SystemVersionEQ(StringAttr.StringEQ): type = 'system version' title = 'System Version' action = 'test system version' def val(self): return platform23.version() class SystemVersionLE(StringAttr.StringLE): type = 'system version <=' title = 'System Version <=' action = 'test system version <=' def val(self): return platform23.version() class SystemVersionLT(StringAttr.StringLT): type = 'system version <' title = 'System Version <' action = 'test system version <' def val(self): return platform23.version() class SystemVersionGE(StringAttr.StringGE): type = 'system version >=' title = 'System Version >=' action = 'test system version >=' def val(self): return platform23.version() class SystemVersionGT(StringAttr.StringGT): type = 'system version >' title = 'System Version >' action = 'test system version >' def val(self): return platform23.version() class SystemReleaseEQ(StringAttr.StringEQ): type = 'system release string' title = 'System Release String' action = 'test system release string' def val(self): return platform23.release() class SystemReleaseLE(StringAttr.StringLE): type = 'system release string <=' title = 'System Release String <=' action = 'test system release string' def val(self): return platform23.release() class SystemReleaseLT(StringAttr.StringLT): type = 'system release string <' title = 'System Release String <' action = 'test system release string <' def val(self): return platform23.release() class SystemReleaseGE(StringAttr.StringGE): type = 'system release string >=' title = 'System Release String >=' action = 'test system release string >=' def val(self): return platform23.release() class SystemReleaseGT(StringAttr.StringGT): type = 'system release string >' title = 'System Release String >' action = 'test system release string >' def val(self): return platform23.release() class PythonCompiler(StringAttr.StringEQ): type = 'compiler used to compile Python' title = 'Compiler Used to Compile Python' action = 'test compiler used to compile Python' def val(self): return platform23.python_compiler() class CPUSecondsMaximumSoftGE(IntAttr): type = 'CPU seconds soft maximum >=' title = 'CPU Seconds Soft Maximum >=' action = 'CPU seconds soft maximum >=' def satisfied(self): limit = resource.getrlimit(resource.RLIMIT_CPU)[0] if limit>0 and limit0 and limit0 and limit0 and limit0 and limit0 and limit0 and h_limit0 and s_limit0 and limit0 and limit