X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Famgetconf.pl;h=5ae66d92887362d551af9ba5f4a4c4dd0f0492cb;hb=ca9fbb570498b74f4c6adaebd629bff20f146a14;hp=01b88a2a8f96360920c1a5c2ab00d6b8479ea7f3;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/installcheck/amgetconf.pl b/installcheck/amgetconf.pl index 01b88a2..5ae66d9 100644 --- a/installcheck/amgetconf.pl +++ b/installcheck/amgetconf.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2007,2008,2009 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -16,7 +16,9 @@ # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More tests => 82; +use Test::More tests => 86; +use strict; +use warnings; use lib "@amperldir@"; use Installcheck; @@ -333,5 +335,20 @@ is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'dumptype:testdu is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'dumptype:testdump:include')))], [sort('FILE OPTIONAL "ifo"', 'LIST OPTIONAL "ilo"')], - "a final 'OPTIONAL' makes the whole include/exclude optional") + "a final 'OPTIONAL' makes the whole include/exclude optional"); + +$testconf = Installcheck::Config->new(); +$testconf->add_param("property", '"prop1" "value1"'); +$testconf->add_param("property", '"prop2" "value2"'); +$testconf->add_param("property", '"prop3" "value3"'); +$testconf->write(); + +is(run_get('amgetconf', 'TESTCONF', "property:prop1"), "value1", + "correctly returns property prop1 from the file"); +is(run_get('amgetconf', 'TESTCONF', "property:prop2"), "value2", + "correctly returns property prop2 from the file"); +is(run_get('amgetconf', 'TESTCONF', "property:prop3"), "value3", + "correctly returns property prop3 from the file"); +is(run_get('amgetconf', 'TESTCONF', "property"), "\"prop1\" \"value1\"\n\"prop2\" \"value2\"\n\"prop3\" \"value3\"", + "correctly returns all propertiss from the file");