fixed some unittests

small layout improvements
added german translations for data and disks plugins
remove leading empty lines in html output to fix tidy warnings
This commit is contained in:
lars 2006-12-14 13:19:37 +00:00
parent 4d61bfbe77
commit 3252f23c04
12 changed files with 88 additions and 54 deletions

9
README
View File

@ -35,7 +35,7 @@ Table of contents:
2) Installation
For Debian, Ubuntu and other derivates you should use the debian package:
see https://systemausfall.org/toolforge/debian/
see http://systemausfall.org/toolforge/debian/
There are currently no official rpm packages of the CryptoBox.
@ -53,6 +53,13 @@ The installed files can be found in your local python installation directory.
The default location should be:
/usr/lib/python2.4/site-packages/cryptobox
Adapt the directories given in /etc/cryptobox-server/cryptobox.conf to your
local installation. The paths below /usr/share should be below your python
directoy instead (see above) - sorry for this inconvenience!
The CryptoBox webserver daemon that is given in /etc/init.d/cryptobox-server
may have to be changed to /usr/bin instead of /usr/sbin.
As some actions of the cryptobox require root privileges, you have to add the
following line to /etc/super.tab:
CryptoBoxRootActions /usr/bin/CryptoBoxRootActions cryptobox

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:04+0100\n"
"PO-Revision-Date: 2006-11-29 19:38+0100\n"
"PO-Revision-Date: 2006-12-14 03:43+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -102,4 +102,4 @@ msgstr "Es wurde ein ungültiger Wert für das Datum oder die Uhrzeit eingegeben
#: Help.ChangeDate
msgid "Change the time and date for the CryptoBox server."
msgstr ""
msgstr "Einstellen der Uhrzeit und des Datums des CryptoBox-Servers."

View File

@ -1,10 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2006-12-14 03:46+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -15,16 +14,16 @@ msgstr ""
#: Name
msgid "Disk overview"
msgstr ""
msgstr "Datenträgerübersicht"
#: Link
msgid "Disks"
msgstr ""
msgstr "Datenträger"
#: Title.Disks
msgid "Available disks"
msgstr ""
msgstr "Verfügbare Datenträger"
#: AdviceMessage.NoDisksAvailable.Text
msgid "No available disks were found!"
msgstr ""
msgstr "Keine verfügbaren Daträger gefunden!"

View File

@ -1,10 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:03+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2006-12-14 03:47+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -15,8 +14,8 @@ msgstr ""
#: Name
msgid "User manual"
msgstr ""
msgstr "Nutzerhandbuch"
#: Link
msgid "Help"
msgstr ""
msgstr "Hilfe"

View File

@ -1,10 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:03+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2006-12-14 03:53+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -15,16 +14,16 @@ msgstr ""
#: Name
msgid "Choose interface language"
msgstr ""
msgstr "Wähle eine Nutzersprache"
#: Link
msgid "Languages"
msgstr ""
msgstr "Sprachen"
#: Title.Language
msgid "Choose an interface language"
msgstr ""
msgstr "Wähle eine Nutzersprache"
#: Help.Select
msgid "Choose your preferred interface language. This setting will be kept for your browsing session."
msgstr ""
msgstr "Wähle deine bevorzugte Nutzersprache. Diese Einstellung wird für die Dauer deiner Sitzung gepeichert."

View File

@ -64,8 +64,8 @@
<?cs call:print_form_header("part_finish", "partition") ?>
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
<input type="hidden" name="step" value="finish" />
<button type="submit"><?cs var:html_escape(Lang.Plugins.partition.Button.SavePartitions) ?></button>
<p><input type="hidden" name="step" value="finish" />
<button type="submit"><?cs var:html_escape(Lang.Plugins.partition.Button.SavePartitions) ?></button></p>
</form>
<?cs /if ?>

View File

@ -1,10 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2006-12-14 03:54+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -15,8 +14,8 @@ msgstr ""
#: Name
msgid "System preferences"
msgstr ""
msgstr "Systemsteuerung"
#: Link
msgid "Preferences"
msgstr ""
msgstr "Einstellungen"

View File

@ -55,15 +55,21 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
## mount the volume
self.cmd.go(url)
self.cmd.find('Open volume')
self.cmd.formvalue("mount", "pw", "foo")
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.formvalue("mount", "pw", "foo")
#self.cmd.submit()
self.cmd.go(url + "&action=mount_luks&pw=foo")
self.cmd.find('Volume opened')
self.cmd.find('Data.Status.Plugins.volume_mount=active')
## try to mount active volume
self.cmd.go(url + "&action=mount_luks&pw=foo")
self.cmd.find('The volume is already open.')
## close the volume
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.submit()
self.cmd.go(url + "&action=umount")
self.cmd.find('Volume closed')
self.cmd.find('Data.Status.Plugins.volume_mount=passive')
## try plain instead of luks
@ -88,14 +94,20 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
## open plain volume
self.cmd.go(url)
self.cmd.find('Open volume')
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.submit()
self.cmd.go(url + "&action=mount_plain")
self.cmd.find('Volume opened')
self.cmd.find('Data.Status.Plugins.volume_mount=active')
## try to mount active volume
self.cmd.go(url + "&action=mount_plain")
self.cmd.find('The volume is already open.')
## umount
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.submit()
self.cmd.go(url + "&action=umount")
self.cmd.find('Volume closed')
self.cmd.find('Data.Status.Plugins.volume_mount=passive')
## try to umount closed volume
@ -110,14 +122,21 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
self.register_auth(url)
self.cmd.go(url)
self.cmd.find('select name="fs_type"')
self.cmd.formvalue("set_type", "fs_type", "linux")
self.cmd.formvalue("set_type", "container_type", "luks")
self.cmd.formvalue("set_type", "confirm", "1")
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.formvalue("set_type", "fs_type", "linux")
#self.cmd.formvalue("set_type", "container_type", "luks")
#self.cmd.formvalue("set_type", "confirm", "1")
#self.cmd.submit()
self.cmd.go(url + "&fs_type=linux&container_type=luks&confirm=1&store=step1")
self.cmd.find('name="crypto_password"')
self.cmd.formvalue("set_luks", "crypto_password", "foo")
self.cmd.formvalue("set_luks", "crypto_password2", "foo")
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.formvalue("set_luks", "crypto_password", "foo")
#self.cmd.formvalue("set_luks", "crypto_password2", "foo")
#self.cmd.submit()
self.cmd.go(url + "&store=step2&container_type=luks&fs_type=windows&" \
+ "crypto_password=foo&crypto_password2=foo")
self.cmd.find('Formatting is running')
self.__wait_until_ready()
@ -129,10 +148,13 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
self.register_auth(url)
self.cmd.go(url)
self.cmd.find('select name="fs_type"')
self.cmd.formvalue("set_type", "fs_type", "windows")
self.cmd.formvalue("set_type", "container_type", "plain")
self.cmd.formvalue("set_type", "confirm", "1")
self.cmd.submit()
# the following _should_ work, but it does not - probably a parsing problem
# of twill - for now we use the direct link instead
#self.cmd.formvalue("set_type", "fs_type", "windows")
#self.cmd.formvalue("set_type", "container_type", "plain")
#self.cmd.formvalue("set_type", "confirm", "1")
#self.cmd.submit()
self.cmd.go(url + "&store=step1&confirm=1&container_type=plain&fs_type=windows")
self.cmd.find('Formatting is running')
self.__wait_until_ready()

View File

@ -1,10 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CryptoBox-Server 0.3\n"
"Report-Msgid-Bugs-To: translate@cryptobox.org\n"
"POT-Creation-Date: 2006-11-28 05:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2006-12-14 03:56+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
@ -15,12 +14,12 @@ msgstr ""
#: Name
msgid "Volume properties"
msgstr ""
msgstr "Datenträgereigenschaften"
#: Link
msgid "Properties"
msgstr ""
msgstr "Eigenschaften"
#: AdviceMessage.NoPropertyPlugins.Text
msgid "No volume property plugins are available."
msgstr ""
msgstr "Es sind keine Datenträger-Erweiterungen verfügbar."

View File

@ -37,6 +37,9 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
"""Try to rename the volume.
"""
save_name = self.__get_name()
## rename if the name is already "foo"
if save_name == "foo":
self.__set_name("bar")
## set 'foo'
self.__set_name("foo")
self.cmd.find('The name of this volume was changed successfully.')
@ -70,7 +73,7 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
self.__set_name("foo/")
self.cmd.find("Changing of volume's name failed")
self.assertEquals("foo", self.__get_name())
self.__set_name("foo&")
self.__set_name("foo/")
self.cmd.find("Changing of volume's name failed")
self.assertEquals("foo", self.__get_name())
self.__set_name("foo*")
@ -124,11 +127,15 @@ class unittests(cryptobox.web.testclass.WebInterfaceTestClass):
def __set_name(self, name):
"""Set the name of a volume.
"""
name = name.replace(" ", "%20")
url = self.url + "volume_rename?weblang=en&device=%2Fdev%2F" + self.device
self.register_auth(url)
self.cmd.go(url)
self.cmd.formvalue("set_name", "vol_name", name)
self.cmd.submit()
# the following should work, but twill seems to have problems to recognize
# the form - fix this later
#self.cmd.go(url)
#self.cmd.formvalue("set_name", "vol_name", name)
#self.cmd.submit()
self.cmd.go(url + "&vol_name=%s&store=1" % name)
def __get_name(self):

View File

@ -623,7 +623,11 @@ class WebInterfaceSites:
## is there a generator containing additional information?
if not generator:
## all content in one flush
yield cs_data.render()
result_data = cs_data.render().splitlines()
## remove empty leading lines (avoids html warnings)
while not result_data[0].strip():
del result_data[0]
yield "\n".join(result_data)
else:
content_generate = generator()
dummy_line = """<!-- CONTENT_DUMMY -->"""

View File

@ -70,9 +70,8 @@
set:logoFile = "cbx-text-logo1.png" ?><?cs
/if ?>
<div class="logo"><a href="<?cs call:link("", "", "", "", "")
?>" title="CryptoBox" alt="CryptoBox logo">
<img src="cryptobox-misc/<?cs var:logoFile ?>"
alt="icon: logo" />
?>" title="CryptoBox"><img src="cryptobox-misc/<?cs var:logoFile
?>" alt="icon: logo" />
</a></div>
<?cs call:help_link() ?>
</td></tr></table>