From 17a4b29ac8bc47ae75bafa0889709a15f1a05393 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 14 Apr 2007 00:03:11 +0000 Subject: modules/chksump_checker: Add a oetest that will write checksum files for us --- modules/chksum_checker/.mtn2git_empty | 0 modules/chksum_checker/__init__.py | 41 +++++++++++++++++++++ modules/chksum_checker/chksum.py | 67 +++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 modules/chksum_checker/.mtn2git_empty create mode 100644 modules/chksum_checker/__init__.py create mode 100644 modules/chksum_checker/chksum.py diff --git a/modules/chksum_checker/.mtn2git_empty b/modules/chksum_checker/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/chksum_checker/__init__.py b/modules/chksum_checker/__init__.py new file mode 100644 index 0000000000..05b3358d00 --- /dev/null +++ b/modules/chksum_checker/__init__.py @@ -0,0 +1,41 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# +# Copyright (C) 2007 Holger Hans Peter Freyther +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# Neither the name Holger Hans Peter Freyther nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +import chksum + +__all__ = [ + "create_test" +] +def create_test(): + return chksum.TestCase() diff --git a/modules/chksum_checker/chksum.py b/modules/chksum_checker/chksum.py new file mode 100644 index 0000000000..236a14a67d --- /dev/null +++ b/modules/chksum_checker/chksum.py @@ -0,0 +1,67 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# +# Copyright (C) 2007 Holger Hans Peter Freyther +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# Neither the name Holger Hans Peter Freyther nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +from bittest import TestItem + +class TestCase: + """ + A simple test case + """ + + def __init__(self): + """ + Construct and initialize the test case + """ + + def setup(self, config): + print "Create" + pass + + def finish(self, config): + print "Finish" + pass + + def test(self,file_name, file_data): + """ + Now run the test for file_name and the corresponding data. + You can use whatever you want + """ + + return TestItem(file_name,False,"The Test Failed") + + def test_name(self): + """ + Retutnr a name for the test + """ + return "Create a checksum file" -- cgit 1.2.3-korg