3 # This file is part of DisOrder.
4 # Copyright (C) 2009 Richard Kettlewell
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 import dtest
,disorder
,re
22 configpath
= "%s/config" % dtest
.testroot
23 config
= open(configpath
, "r").readlines()
24 config
= filter(lambda l
: not re
.match('authorization_algorithm', l
),
26 config
.append('authorization_algorithm %s\n' % h
)
27 open(configpath
, "w").write("".join(config
))
30 """Authentication hash tests"""
32 for h
in ['sha1', 'SHA1', 'sha256', 'SHA256',
33 'sha384', 'SHA384', 'sha512', "SHA512" ]:
34 print " setting authorization hash to %s" % h
40 print " exercising C implementation"
41 dtest
.command(["disorder",
42 "--config", disorder
._configfile
, "--no-per-user-config",
43 "--user", "root", "version"])
44 print " exercising Python implementation"
49 if __name__
== '__main__':