X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Famgetconf.pl;h=2854d20f1670072f007b4ce12d6e009e6409ad68;hb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;hp=3d7f8d8ff02af0ae6b8812eb32b96b3b12649391;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;p=debian%2Famanda diff --git a/installcheck/amgetconf.pl b/installcheck/amgetconf.pl index 3d7f8d8..2854d20 100644 --- a/installcheck/amgetconf.pl +++ b/installcheck/amgetconf.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2007-2012 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,7 @@ # 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; @@ -216,7 +216,7 @@ is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'device_property $testconf = Installcheck::Config->new(); $testconf->add_tapetype("cassette", [ length => "32 k" ]); $testconf->add_tapetype("reel2reel", [ length => "1 M" ]); -$testconf->add_tapetype("scotch", [ length => "500 bytes" ]); # (use a sharpie) +$testconf->add_tapetype("scotch", [ length => "512000 bytes" ]); $testconf->add_dumptype("testdump", [ comment => '"testdump-dumptype"', auth => '"bsd"' ]); $testconf->add_dumptype("testdump1", [ inherit => 'testdump' ]); @@ -335,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");