+is(run_get('amgetconf', 'TESTCONF', "send_amreport_on"), "ALL",
+ "send_amreport_on defaults to 'ALL'"); # (enum value is 0)
+is(run_get('amgetconf', 'TESTCONF', "taperalgo"), "FIRST",
+ "taperalgo defaults to 'ALL'"); # (enum value is 0)
+is(run_get('amgetconf', 'TESTCONF', "printer"), "",
+ "printer defaults to empty string, which is not an error");
+
+# test command-line parsing
+is(run_get('amgetconf', 'TESTCONF', '--execute-where', 'client', 'amandates'),
+ $Amanda::Constants::DEFAULT_AMANDATES_FILE,
+ "--execute-where client");
+is(run_get('amgetconf', 'TESTCONF', '--execute-where=client', 'amandates'),
+ $Amanda::Constants::DEFAULT_AMANDATES_FILE,
+ "--execute-where=client");
+is(run_get('amgetconf', 'TESTCONF', '--client', 'amandates'),
+ $Amanda::Constants::DEFAULT_AMANDATES_FILE,
+ "--client");
+
+is(run_get('amgetconf', 'TESTCONF', '--execute-where', 'server', 'reserve'), "100",
+ "--execute-where server");
+is(run_get('amgetconf', 'TESTCONF', '--execute-where=server', 'reserve'), "100",
+ "--execute-where=server");
+is(run_get('amgetconf', 'TESTCONF', '--execute-where=server', '--execute-where=server', 'reserve'), "100",
+ "--execute-where=server --execute-where=server");
+is(run_get('amgetconf', 'TESTCONF', '--execute-where=client', '--execute-where=client', 'amandates'),
+ $Amanda::Constants::DEFAULT_AMANDATES_FILE,
+ "--execute-where=client --execute-where=client");
+
+like(run_err('amgetconf', 'TESTCONF', '--execute-where=server', '--execute-where=client'),
+ qr/conflicts with/,
+ "handles conflict --execute-where=server --execute-where=client");
+like(run_err('amgetconf', 'TESTCONF', '--execute-where=client', '--execute-where=server'),
+ qr/conflicts with/,
+ "handles conflict --execute-where=client --execute-where=server");
+like(run_err('amgetconf', 'TESTCONF', '--execute-where=server', '--client'),
+ qr/conflicts with/,
+ "handles conflict --execute-where=server --client");
+like(run_err('amgetconf', 'TESTCONF', '--client', '--execute-where=server'),
+ qr/conflicts with/,
+ "handles conflict --client --execute-where=server");
+
+is(run_get('amgetconf', 'TESTCONF', '-o', 'reserve=50', 'reserve'), "50",
+ "-o reserve=50");
+is(run_get('amgetconf', 'TESTCONF', '-oreserve=50', 'reserve'), "50",
+ "-oreserve=50");
+is(run_get('amgetconf', '-o', 'reserve=50', 'TESTCONF', 'reserve'), "50",
+ "-oreserve=50 before config name");
+is(run_get('amgetconf', 'TESTCONF', 'reserve', 'a', 'table', 'for', 'two', '-o', 'reserve=50'), "50",
+ "extra command-line arguments are ignored");