Commit 147c0add authored by Per Cederqvist's avatar Per Cederqvist

Renamed the error code illegal-aux-item to illegal-aux-item-tag.

Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
Return proper error codes.  (Bug 192).
* doc/Protocol-A.texi (Predefined Aux-Item Types): Renamed the
error code illegal-aux-item to illegal-aux-item-tag.
(create-text): Updated the error code section to mention the
aux-related error codes illegal-aux-item-tag, aux-item-permission,
aux-exists, aux-bad-object, illegal-aux-data, aux-modify-only,
aux-server-only, aux-data-exists and aux-no-such-text instead of
only illegal-aux-item and aux-item-permission.  Refer to the
"Error Codes" node instead of duplicating the reasons here.
(create-anonymous-text): Ditto.
(create-conf): Ditto.
(create-person): Ditto.
(modify-text-info): Ditto, but with aux-create-only instead of
aux-modify-only.
(modify-conf-info): Ditto.
(modify-system-info): Ditto.
(Error Codes): Renamed error code 48 from illegal-aux-item to
illegal-aux-item-tag, and redefine it to not include errors in the
data.  Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
* doc/Makefile.am (check-doc): Replaced the error code
illegal-aux-item with illegal-aux-item-tag and
illegal-aux-item-data.
* src/include/kom-errno.h (enum kom_err): Renamed KOM_ILL_AUX to
KOM_ILL_AUX_TAG.  Added KOM_AUX_EXISTS, KOM_AUX_BAD_OBJECT,
KOM_ILL_AUX_DATA, KOM_AUX_CREATE_ONLY, KOM_AUX_MODIFY_ONLY,
KOM_AUX_SERVER_ONLY, KOM_AUX_DATA_EXISTS and KOM_AUX_NO_SUCH_TEXT.
* src/server/aux-items.c (aux_item_validate): Doc added.  Added
missing punctuation in comments.  Set kom_errno to
KOM_ILL_AUX_DATA instead of KOM_ILL_AUX when a regexp cannot be
compiled or doesn't match an entry, or when a validator fails.
(aux_item_add_perm): Document that kom_errno is set on failure.
Do not modify kom_errno on success.  Track name change of
KOM_ILL_AUX_TAG.  Set KOM_AUX_MODIFY_ONLY, KOM_AUX_CREATE_ONLY,
KOM_AUX_SERVER_ONLY when appropriate (used to be KOM_AUX_PERM).
Don't override the error code set by aux_item_check_unique() or
aux_item_validate() when any of those check fails.
(aux_item_check_unique): Set kom_errno to KOM_AUX_EXISTS or
KOM_AUX_DATA_EXISTS on failure (used to sometimes be
KOM_ILL_AUX).
(text_stat_check_add_aux_item_list): Track name change of
KOM_ILL_AUX_TAG.  Set kom_errno to KOM_AUX_BAD_OBJECT if the
aux-item is not allowed on the active object (used to be
KOM_AUX_PERM).
(conf_stat_check_add_aux_item_list): Ditto.
(system_check_add_aux_item_list): Ditto.
(aux_item_validate_existing_text): Set kom_errno to
KOM_AUX_NO_SUCH_TEXT instead of NO_SUCH_TEXT.  Set it to
KOM_ILL_AUX_DATA if the text number is non-numeric.
* src/server/testsuite/lyskomd.0/00.exp: Updated the expected
error codes for aux-item-related errors.
* src/server/testsuite/lyskomd.0/03.exp: Ditto.
* src/server/testsuite/lyskomd.0/04.exp: Ditto.
* src/server/testsuite/lyskomd.0/14.exp: Ditto.
* src/server/testsuite/lyskomd.0/17.exp: Ditto.
* src/server/testsuite/lyskomd.0/55.exp: Ditto.
* src/server/testsuite/lyskomd.0/aux-items-cov.exp: Ditto.
* src/server/testsuite/lyskomd.0/bug-572.exp: Ditto.
* src/server/testsuite/lyskomd.0/20.exp: Ditto.  Remove the
want_illegal_aux_item proc and simplify the code that checks the
error codes.
* src/server/testsuite/lyskomd.0/23.exp: Ditto.
* src/server/testsuite/lyskomd.0/26.exp: Ditto.
* src/server/testsuite/lyskomd.0/28.exp: Ditto.

Added test cases for handling duplicate faq-text aux-items.
* src/server/testsuite/lyskomd.0/21.exp: Added new tests that
attempt to set duplicate faq-text aux-items on a conference in
various ways, and removing it and re-adding it.  Also test adding
two different faq-text aux-items at the same time.
parent 16e3ba24
2006-09-28 Per Cederqvist <ceder@lysator.liu.se>
Renamed the error code illegal-aux-item to illegal-aux-item-tag.
Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
Return proper error codes. (Bug 192).
* doc/Protocol-A.texi (Predefined Aux-Item Types): Renamed the
error code illegal-aux-item to illegal-aux-item-tag.
(create-text): Updated the error code section to mention the
aux-related error codes illegal-aux-item-tag, aux-item-permission,
aux-exists, aux-bad-object, illegal-aux-data, aux-modify-only,
aux-server-only, aux-data-exists and aux-no-such-text instead of
only illegal-aux-item and aux-item-permission. Refer to the
"Error Codes" node instead of duplicating the reasons here.
(create-anonymous-text): Ditto.
(create-conf): Ditto.
(create-person): Ditto.
(modify-text-info): Ditto, but with aux-create-only instead of
aux-modify-only.
(modify-conf-info): Ditto.
(modify-system-info): Ditto.
(Error Codes): Renamed error code 48 from illegal-aux-item to
illegal-aux-item-tag, and redefine it to not include errors in the
data. Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
* doc/Makefile.am (check-doc): Replaced the error code
illegal-aux-item with illegal-aux-item-tag and
illegal-aux-item-data.
* src/include/kom-errno.h (enum kom_err): Renamed KOM_ILL_AUX to
KOM_ILL_AUX_TAG. Added KOM_AUX_EXISTS, KOM_AUX_BAD_OBJECT,
KOM_ILL_AUX_DATA, KOM_AUX_CREATE_ONLY, KOM_AUX_MODIFY_ONLY,
KOM_AUX_SERVER_ONLY, KOM_AUX_DATA_EXISTS and KOM_AUX_NO_SUCH_TEXT.
* src/server/aux-items.c (aux_item_validate): Doc added. Added
missing punctuation in comments. Set kom_errno to
KOM_ILL_AUX_DATA instead of KOM_ILL_AUX when a regexp cannot be
compiled or doesn't match an entry, or when a validator fails.
(aux_item_add_perm): Document that kom_errno is set on failure.
Do not modify kom_errno on success. Track name change of
KOM_ILL_AUX_TAG. Set KOM_AUX_MODIFY_ONLY, KOM_AUX_CREATE_ONLY,
KOM_AUX_SERVER_ONLY when appropriate (used to be KOM_AUX_PERM).
Don't override the error code set by aux_item_check_unique() or
aux_item_validate() when any of those check fails.
(aux_item_check_unique): Set kom_errno to KOM_AUX_EXISTS or
KOM_AUX_DATA_EXISTS on failure (used to sometimes be
KOM_ILL_AUX).
(text_stat_check_add_aux_item_list): Track name change of
KOM_ILL_AUX_TAG. Set kom_errno to KOM_AUX_BAD_OBJECT if the
aux-item is not allowed on the active object (used to be
KOM_AUX_PERM).
(conf_stat_check_add_aux_item_list): Ditto.
(system_check_add_aux_item_list): Ditto.
(aux_item_validate_existing_text): Set kom_errno to
KOM_AUX_NO_SUCH_TEXT instead of NO_SUCH_TEXT. Set it to
KOM_ILL_AUX_DATA if the text number is non-numeric.
* src/server/testsuite/lyskomd.0/00.exp: Updated the expected
error codes for aux-item-related errors.
* src/server/testsuite/lyskomd.0/03.exp: Ditto.
* src/server/testsuite/lyskomd.0/04.exp: Ditto.
* src/server/testsuite/lyskomd.0/14.exp: Ditto.
* src/server/testsuite/lyskomd.0/17.exp: Ditto.
* src/server/testsuite/lyskomd.0/55.exp: Ditto.
* src/server/testsuite/lyskomd.0/aux-items-cov.exp: Ditto.
* src/server/testsuite/lyskomd.0/bug-572.exp: Ditto.
* src/server/testsuite/lyskomd.0/20.exp: Ditto. Remove the
want_illegal_aux_item proc and simplify the code that checks the
error codes.
* src/server/testsuite/lyskomd.0/23.exp: Ditto.
* src/server/testsuite/lyskomd.0/26.exp: Ditto.
* src/server/testsuite/lyskomd.0/28.exp: Ditto.
Added test cases for handling duplicate faq-text aux-items.
* src/server/testsuite/lyskomd.0/21.exp: Added new tests that
attempt to set duplicate faq-text aux-items on a conference in
various ways, and removing it and re-adding it. Also test adding
two different faq-text aux-items at the same time.
2006-09-09 Per Cederqvist <ceder@lysator.liu.se>
Get rid of gcc-4.1.1 warnings by initializing more fields.
......
......@@ -253,7 +253,8 @@ if HAVE_PYTHON
-e 's/ undef-session$$/ undefined-session/' \
-e 's/ tempfail$$/ temporary-failure/' \
-e 's/ anon-rejected$$/ anonymous-rejected/' \
-e 's/ ill-aux$$/ illegal-aux-item/' \
-e 's/ ill-aux-tag$$/ illegal-aux-item-tag/' \
-e 's/ ill-aux-data$$/ illegal-aux-item-data/' \
-e 's/ aux-perm$$/ aux-item-permission/' \
| tee errorcodes-numbered.tmp \
| sed 's/[0-9]* //' \
......
......@@ -833,7 +833,7 @@ field of an item, regardless of what the client requests.
All items with tags in the range 1-9999 and 30000 and up are considered
predefined. If a client attempts to create an item with a tag in this
range, but the server has no idea what that tag means, the server will
return an error (@errorcode{illegal-aux-item}).
return an error (@errorcode{illegal-aux-item-tag}).
Some items with tags in the range 10000-19999 are also predefined.
They are items that initially were reserved for private use for a
......@@ -7242,12 +7242,17 @@ anonymous texts.
Invalid misc-info list. A recipient is listed more than once or there is
an unknown misc item in the misc-info list.
@item illegal-aux-item
One of the aux-items in @rarg{aux-items} is illegal. The tag might be
out of range, the item not applicable to texts or whatever.
@item aux-item-permission
One of the items looks valid but could not be created anyway.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-modify-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{aux-items} is illegal. @xref{Error
Codes}, for the meaning of the various errors.
@item long-array
Too many Misc-Info items or aux-items were specified.
......@@ -7310,11 +7315,19 @@ anonymous texts.
@item illegal-misc
Invalid misc-info list. A recipient is listed more than once or there is
an unknown misc item in the misc-info list.
@item illegal-aux-item
One of the aux-items in @rarg{aux-items} is illegal. The tag might be
out of range, the item not applicable to texts or whatever
@item aux-item-permission
One of the items looks valid but could not be created anyway.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-modify-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{aux-items} is illegal. @xref{Error
Codes}, for the meaning of the various errors.
@end table
......@@ -7364,12 +7377,17 @@ A conference named @rarg{name} already exists.
The conference type has the @conftype{secret} bit set, but the
@conftype{rd-prot} bit is cleared.
@item illegal-aux-item
One of the aux-items in @rarg{aux-items} is illegal. The tag might be
out of range, the item not applicable to conferences or whatever
@item aux-item-permission
One of the items looks valid but could not be created anyway.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-modify-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{aux-items} is illegal. @xref{Error
Codes}, for the meaning of the various errors.
@item index-out-of-range
Attempt to create a conference failed because we reached the maximum
......@@ -7426,13 +7444,17 @@ There is already a person named @rarg{name}.
@item invalid-password
The string @rarg{passwd} is not a valid password.
@item illegal-aux-item
One of the aux-items in @rarg{aux-items} is illegal. The tag might be
out of range, the item not applicable to conferences or mailboxes or
whatever.
@item aux-item-permission
One of the items looks valid but could not be created anyway.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-modify-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{aux-items} is illegal. @xref{Error
Codes}, for the meaning of the various errors.
@item index-out-of-range
Attempt to create a person failed because we reached the maximum
......@@ -7518,12 +7540,20 @@ completely fail or completely succeed.
Login required before issuing this call.
@item no-such-text
The text @rarg{text} does not exist or is secret.
@item aux-item-permission
No permission to delete one or more of the items in @rarg{delete}, or
@rarg{delete} indicates a non-existent aux-item, or not enough
permissions to add one or more of the items in @rarg{add}.
@item illegal-aux-item
One of the items in @rarg{add} is illegal for some reason.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-create-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{add} is illegal, or one of items in
@rarg{delete} cannot be deleted or does not exist. @xref{Error
Codes}, for the meaning of the various errors.
@end table
......@@ -7554,12 +7584,20 @@ to either completely fail or completely succeed.
Login required before issuing this call.
@item undefined-conference
The conference @rarg{conf} does not exist or is secret.
@item aux-item-permission
No permission to delete one or more of the items in @rarg{delete}, or
@rarg{delete} indicates a non-existent aux-item, or not enough
permissions to add one or more of the items in @rarg{add}.
@item illegal-aux-item
One of the items in @rarg{add} is illegal for some reason.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-create-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{add} is illegal, or one of items in
@rarg{delete} cannot be deleted or does not exist. @xref{Error
Codes}, for the meaning of the various errors.
@end table
......@@ -7610,12 +7648,20 @@ deletions or additions succeeded, or none of them is made.
Login requires before issuing this call.
@item permission-denied
Admin bit not set or privileges not enabled.
@item illegal-aux-item
Attempt to create an invalid aux item.
@item aux-item-permission
No permission to delete one or more of the items in @rarg{items-to-delete}, or
@rarg{items-to-delete} indicates a non-existent aux-item, or not enough
permissions to add one or more of the items in @rarg{items-to-add}.
@item illegal-aux-item-tag
@itemx aux-item-permission
@itemx aux-exists
@itemx aux-bad-object
@itemx illegal-aux-data
@itemx aux-create-only
@itemx aux-server-only
@itemx aux-data-exists
@itemx aux-no-such-text
One of the aux-items in @rarg{items-to-add} is illegal, or one of
items in @rarg{items-to-delete} cannot be deleted or does not exist.
@xref{Error Codes}, for the meaning of the various errors.
@end table
......@@ -9664,10 +9710,10 @@ undefined.
Attempt to send an anonymous text to a conference that does not accept
anonymous texts. @field{error-status} is undefined.
@item illegal-aux-item (48)
Attempt to create an invalid aux-item. Probably the tag or data are
invalid. @field{error-status} contains the index in the aux-item list
where the invalid item appears.
@item illegal-aux-item-tag (48)
Attempt to create an invalid aux-item. The tag is invalid.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-item-permission (49)
Attempt to manipulate an aux-item without enough permissions. This
......@@ -9733,6 +9779,59 @@ An argument of type @type{BOOL} was given a value that is neither
@samp{0} nor @samp{1}.
@field{error-status} is undefined.
@item aux-exists (62)
The aux-item tag is already set on the specified object, and that tag
can only be used once (or once per person, and the tag is already set
by you).
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-bad-object (63)
The specified aux-item tag cannot be set on the type of object you are
attempting to set it on.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item illegal-aux-data (64)
The value of an aux-item is not acceptable. @xref{Aux-Item Types},
for more information.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-create-only (65)
You are attempting to add a an aux-item to a pre-existing object, but
the aux-item type only allows it to be specified when the object is
created.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-modify-only (66)
You are attempting to add a an aux-item while creating an object, but
the aux-item type only allows it to be added at a later time.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-server-only (67)
You are attempting to add an aux-item of a type that can only be added
by the server itself.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-data-exists (68)
You are attempting to add an aux-item whose value must be unique (such
as @aux{faq-text}), and such an aux-item already exists on the object.
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@item aux-no-such-text (69)
You are attempting to add an aux-item whose value is (or contains) a
text number, and no such text number exists (or the text is not
readable by you).
@field{error-status} contains the index in the aux-item list where the
invalid item appears.
@end table
......
......@@ -85,8 +85,8 @@ enum kom_err
KOM_TEMPFAIL = 45, /* Try again later. */
KOM_LONG_ARRAY = 46, /* Too long array supplied. */
KOM_ANON_REJECTED = 47, /* Anonymous text not allowed in conference. */
KOM_ILL_AUX = 48, /* Bad misc item */
KOM_AUX_PERM = 49, /* No permission to set aux */
KOM_ILL_AUX_TAG = 48, /* Bad aux item tag value. */
KOM_AUX_PERM = 49, /* No permission to set aux item. */
KOM_UNKNOWN_ASYNC = 50, /* Accepting an unknown async message */
KOM_INTERNAL_ERROR = 51, /* Internal server error */
KOM_FEATURE_DISABLED = 52, /* Server feature is disabled */
......@@ -99,6 +99,14 @@ enum kom_err
KOM_WEIGHT_DENIED = 59, /* You cannot increase your weight that much.*/
KOM_WEIGHT_ZERO = 60, /* You cannot increase your weight that much.*/
KOM_BAD_BOOL = 61, /* A Bool must be 0 or 1. */
KOM_AUX_EXISTS = 62, /* Attempt to set use the same tag twice. */
KOM_AUX_BAD_OBJECT = 63, /* Aux item cannot be set on this object. */
KOM_ILL_AUX_DATA = 64, /* Bad aux item value. */
KOM_AUX_CREATE_ONLY = 65, /* Aux item cannot be added later. */
KOM_AUX_MODIFY_ONLY = 66, /* Aux item can only be added later. */
KOM_AUX_SERVER_ONLY = 67, /* Aux item can only be added by the server. */
KOM_AUX_DATA_EXISTS = 68, /* Attempt to set use the same value twice. */
KOM_AUX_NO_SUCH_TEXT = 69, /* Attempt to link to non-existing text. */
KOM_num_errs /* End marker */
};
......
This diff is collapsed.
......@@ -347,7 +347,7 @@ simple_expect "=1056 3 3 1 0 0 \\*" "one map (new-style)"
talk_to client 1
send "1057 86 [holl "text0005 failed attempt"] 1 { 0 1 } 1 { 9 00000000 1 [holl "simulated compface data"] }\n"
simple_expect "%1057 49 0" "not allowed to add compface to texts"
simple_expect "%1057 63 0" "not allowed to add compface to texts"
send "1058 86 [holl "text0005"] 1 { 0 1 } 1 { 1 00000000 1 [holl "text/plain"] }\n"
simple_expect ":18 15 5 $any_time 6 0 8 0 2 { 0 1 6 4 } 1 { 1 1 6 $any_time 00000000 1 [holl "text/plain"] }" "async to c1"
......
......@@ -1296,7 +1296,7 @@ send "1344 95 0 { } 2 { 9 00000000 1 [holl "compface must die"] 13 00000000 1 [h
simple_expect "=1344"
# Attempt to set a nonexisting text as faq for the server.
send "1345 95 0 { } 1 { 14 00000000 1 [holl "999"] }\n"
simple_expect "%1345 48 0"
simple_expect "%1345 69 0"
send "1346 94\n"
simple_expect "=1346 $server_compat_version 1 2 3 4 0 2 { 1 9 5 $any_time 00000000 1 [holl "compface must die"] 2 13 5 $any_time 00000000 1 [holl "maint@kom"] }"
......@@ -1599,7 +1599,7 @@ send "1440 1\n"
simple_expect "=1440"
send "1441 89 [holl "Kelly Talisman II"] [holl "the stars"] 00000000 11 { 3 00000000 0 [holl "C6 My Creator"] 3 00000000 0 [holl "C7 Slightly offensive name, huh"] 8 00000000 0 [holl "E-mail:kelly@hotbox.com"] 9 00000000 0 [holl "compface must die"] 10 00000000 0\n"
send "[holl "Air"] 12 00000000 0 [holl "PGP public key"] 13 00000000 0 [holl "kelly@hotbox.com"] 30 00000000 0 [holl "2 text/plain"] 30 00000000 0 [holl "2 x-kom/basic"] 33 00000000 1 1H0 14 00000000 0 [holl "3"] }\n"
simple_expect "%1441 48 10"
simple_expect "%1441 69 10"
# Disconnect all but the first session
......
......@@ -186,7 +186,7 @@ simple_expect "=2022 $any_time 7 0 6 0 3 { 0 9 6 3 2 2 } 2 { 8 1017 7 $any_time
# Attempt to add and delete items where add fails
send "2023 92 3 1 { 8 } 1 { 10000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2023 49 0" "AIT: Creator adding and deleting with add fail (add)"
simple_expect "%2023 63 0" "AIT: Creator adding and deleting with add fail (add)"
send "2024 90 3\n"
simple_expect "=2024 $any_time 7 0 6 0 3 { 0 9 6 3 2 2 } 2 { 8 1017 7 $any_time 00000000 0 [holl "D8"] 9 1018 7 $any_time 00000000 0 [holl "D9"] }" "AIT: Creator adding and deleting with add fail (read)"
......@@ -353,7 +353,7 @@ simple_expect "=2048 [holl "Conference 9"] 00001000 $any_time $any_time 7 0 7 0
# Attempt to add and delete items where add fails
send "2049 93 $conf_9 1 { 8 } 1 { 10000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2049 49 0" "AIC: Add and delete where add fails (add)"
simple_expect "%2049 63 0" "AIC: Add and delete where add fails (add)"
send "2050 91 $conf_9\n"
simple_expect "=2050 [holl "Conference 9"] 00001000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 3 0 2 { 8 1017 7 $any_time 00000000 0 [holl "A8"] 9 1018 7 $any_time 00000000 0 [holl "A9"] }" "AIC: Add and delete where add fails (read)"
......@@ -526,7 +526,7 @@ simple_expect "=2120 $any_num $any_num $any_num $any_num $any_num $any_num 1 { 7
# Try add and delete with add fail
send "2121 95 1 { 7 } 1 { 10001 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2121 49 0" "AIS: Add and delete with add fail (add)"
simple_expect "%2121 63 0" "AIS: Add and delete with add fail (add)"
send "2122 94\n"
simple_expect "=2122 $any_num $any_num $any_num $any_num $any_num $any_num 1 { 7 1009 5 $any_time 00000000 0 [holl "S7"] }" "AIS: Add and delete with add fail (read)"
......@@ -596,19 +596,19 @@ extracting_expect "=2200 ($any*) 0 \\*" text_stat 1
# Add text-only to text
send "2201 92 4 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2201 49 0" "AIR: Add conf-only to text (add)"
simple_expect "%2201 63 0" "AIR: Add conf-only to text (add)"
send "2202 90 4\n"
simple_expect "=2202 $text_stat 0 \\*" "AIR: Add conf-only to text (read)"
send "2203 92 4 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2203 49 0" "AIR: Add letterbox-only to text (add)"
simple_expect "%2203 63 0" "AIR: Add letterbox-only to text (add)"
send "2204 90 4\n"
simple_expect "=2204 $text_stat 0 \\*" "AIR: Add letterbox-only to text (read)"
send "2205 92 4 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2205 49 0" "AIR: Add system-only to text (add)"
simple_expect "%2205 63 0" "AIR: Add system-only to text (add)"
send "2206 90 4\n"
simple_expect "=2206 $text_stat 0 \\*" "AIR: Add system-only to text (read)"
......@@ -629,19 +629,19 @@ send "2300 91 7\n"
extracting_expect "=2300 ($any*) 0 \\*" conf_stat 1
send "2301 93 7 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2301 49 0" "AIR: Adding system-only to letterbox (add)"
simple_expect "%2301 63 0" "AIR: Adding system-only to letterbox (add)"
send "2302 91 7\n"
simple_expect "=2302 $conf_stat 0 \\*" "AIR: Adding system-only to letterbox (read)"
send "2303 93 7 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2303 49 0" "AIR: Adding conf-only to letterbox (add)"
simple_expect "%2303 63 0" "AIR: Adding conf-only to letterbox (add)"
send "2304 91 7\n"
simple_expect "=2304 $conf_stat 0 \\*" "AIR: Adding conf-only to letterbox (read)"
send "2305 93 7 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2305 49 0" "AIR: Adding text-only to letterbox (add)"
simple_expect "%2305 63 0" "AIR: Adding text-only to letterbox (add)"
send "2306 91 7\n"
simple_expect "=2306 $conf_stat 0 \\*" "AIR: Adding text-only to letterbox (read)"
......@@ -665,19 +665,19 @@ send "2400 91 11\n"
extracting_expect "=2400 ($any*) 0 \\*" conf_stat 1
send "2401 93 11 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2401 49 0" "AIR: Adding system-only to conf (add)"
simple_expect "%2401 63 0" "AIR: Adding system-only to conf (add)"
send "2402 91 11\n"
simple_expect "=2402 $conf_stat 0 \\*" "AIR: Adding system-only to conf (read)"
send "2403 93 11 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2403 49 0" "AIR: Adding pers-only to conf (add)"
simple_expect "%2403 63 0" "AIR: Adding pers-only to conf (add)"
send "2404 91 11\n"
simple_expect "=2404 $conf_stat 0 \\*" "AIR: Adding conf-only to conf (read)"
send "2405 93 11 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2405 49 0" "AIR: Adding text-only to conf (add)"
simple_expect "%2405 63 0" "AIR: Adding text-only to conf (add)"
send "2406 91 11\n"
simple_expect "=2406 $conf_stat 0 \\*" "AIR: Adding text-only to conf (read)"
......@@ -703,19 +703,19 @@ send "2500 94\n"
extracting_expect "=2500 ($any*) 0 \\*" info_struct 1
send "2501 95 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2501 49 0" "AIR: Adding pers-only to system (add)"
simple_expect "%2501 63 0" "AIR: Adding pers-only to system (add)"
send "2502 94\n"
simple_expect "=2502 $info_struct 0 \\*" "AIR: Adding pers-only to system (read)"
send "2503 95 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2503 49 0" "AIR: Adding conf-only to system (add)"
simple_expect "%2503 63 0" "AIR: Adding conf-only to system (add)"
send "2504 94\n"
simple_expect "=2504 $info_struct 0 \\*" "AIR: Adding conf-only to system (read)"
send "2505 95 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%2505 49 0" "AIR: Adding text-only to system (add)"
simple_expect "%2505 63 0" "AIR: Adding text-only to system (add)"
send "2506 94\n"
simple_expect "=2506 $info_struct 0 \\*" "AIR: Adding text-only to system (read)"
......@@ -752,7 +752,7 @@ simple_expect "=3003 $text_stat 0 \\*"
# Check content validation
send "3004 92 5 0 { } 1 { 2003 00000000 1 [holl "FAIL"] }\n"
simple_expect "%3004 48 0"
simple_expect "%3004 64 0"
send "3005 90 5\n"
simple_expect "=3005 $text_stat 0 \\*"
......@@ -783,7 +783,7 @@ extracting_expect "=4001 ($any*) 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2
# Try to add second one-per-person item as person A
send "4002 92 6 0 { } 1 { 2006 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%4002 49 0"
simple_expect "%4002 62 0"
send "4003 90 6\n"
simple_expect "=4003 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }"
......@@ -799,7 +799,7 @@ simple_expect "=4005 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2
# Try to add create-restricted item after create
send "4006 92 6 0 { } 1 { 3000 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%4006 49 0"
simple_expect "%4006 65 0"
send "4007 90 6\n"
simple_expect "=4007 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }"
......@@ -813,7 +813,7 @@ kom_login 8 "pw3" 0
# Add two one-per-person at once
send "4100 92 6 0 { } 2 { 2006 00000000 0 [holl "AOB1"] 2006 00000000 0 [holl "AOB2"] }\n"
simple_expect "%4100 49 0"
simple_expect "%4100 62 0"
send "4101 90 6\n"
simple_expect "=4101 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }"
......@@ -831,7 +831,7 @@ simple_expect "=4103 $text_stat 5 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2
# Add another one-per-person as person B
send "4104 92 6 0 { } 1 { 2006 00000000 0 [holl "AOB1"] }\n"
simple_expect "%4104 49 0"
simple_expect "%4104 62 0"
send "4105 90 6\n"
simple_expect "=4105 $text_stat 5 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] 5 2006 8 $any_time 00000000 0 [holl "AOB1"] }"
......@@ -924,7 +924,7 @@ send "4399 91 12\n"
extracting_expect "=4399 ($any*)" conf_stat 1
send "4400 93 11 0 { } 1 { 3001 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%4400 49 0"
simple_expect "%4400 65 0"
send "4401 91 12\n"
simple_expect "=4401 $conf_stat"
......@@ -939,7 +939,7 @@ send "4402 91 13\n"
extracting_expect "=4402 ($any*)" conf_stat 1
send "4403 93 13 0 { } 1 { 3002 00000000 0 [holl "FUBAR"] }\n"
simple_expect "%4403 49 0"
simple_expect "%4403 65 0"
send "4404 91 13\n"
simple_expect "=4404 $conf_stat"
......@@ -964,7 +964,7 @@ send "4503 90 7\n"
simple_expect "=4503 $any_time 7 0 6 1 2 { 0 9 6 7 } 0 \\*"
send "4504 93 14 1 { 1 } 1 { 10000 00000000 0 [holl "FUBAR" ] }\n"
simple_expect "%4504 49 0"
simple_expect "%4504 63 0"
send "4505 90 7\n"
simple_expect "=4505 $any_time 7 0 6 1 2 { 0 9 6 7 } 0 \\*"
......
......@@ -95,7 +95,7 @@ simple_expect "=1017"
# Attempt to add a broken FAQ aux-item with trailing garbage.
send "1018 93 4 0 { } 1 { 14 00000000 0 [holl "3garbage"] }\n"
simple_expect "%1018 48 0"
simple_expect "%1018 64 0"
# Create a proper FAQ item
send "1019 93 4 0 { } 1 { 14 00000000 0 [holl "3"] }\n"
......
......@@ -58,16 +58,16 @@ simple_expect "=1007"
# A few invalid values.
send "1008 95 0 { } 1 { 29 00000000 1 [holl "4 250 00000000 4"] }\n"
simple_expect "%1008 48 0"
simple_expect "%1008 64 0"
send "1009 95 0 { } 1 { 29 00000000 1 [holl "4 00000000"] }\n"
simple_expect "%1009 48 0"
simple_expect "%1009 64 0"
send "1010 95 0 { } 1 { 29 00000000 1 [holl "4 2c0 00000000"] }\n"
simple_expect "%1010 48 0"
simple_expect "%1010 64 0"
send "1011 95 0 { } 1 { 29 00000000 1 [holl "4 250 00200000"] }\n"
simple_expect "%1011 48 0"
simple_expect "%1011 64 0"
# A fourth valid item.
send "1012 95 0 { } 1 { 29 00000000 1 [holl "4 190 00000000"] }\n"
......
This diff is collapsed.
......@@ -535,8 +535,100 @@ simple_expect "%1111 49 0"
# Check that Conference 12 and text 1 looks OK.
send "1112 91 12\n"
simple_expect "=1112 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { 12 14 11 $any_time 00000000 1 [holl "1"] }"
send "1105 90 1\n"
simple_expect "=1105 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 00001000 0 [holl "12"] }"
send "1113 90 1\n"
simple_expect "=1113 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 00001000 0 [holl "12"] }"
# Attempt to set a duplicate faq-text on Conference 12.
talk_to client 2
send "1114 93 12 0 { } 1 { 14 00000000 1 [holl "1"] }\n"
simple_expect "%1114 68 0"
# Attempt to remote a faq-text and add it back later.
send "1115 93 12 1 { 12 } 0 { }\n"
simple_expect "=1115"
send "1116 93 12 0 { } 1 { 14 00000000 1 [holl "1"] }\n"
simple_expect "=1116"
# Attempt to remote a faq-text and add it back in the same operation.
# This should work, but currently fails.
send "1117 93 12 1 { 13 } 1 { 14 00000000 1 [holl "1"] }\n"
if {0} {
simple_expect "=1117"
set aux 14
} else {
simple_expect "%1117 68 0"
setup_xfail "*-*-*" "Bug 1614"
fail "Removing and adding back the same faq-text aux-item in a single operation (got KOM_AUX_DATA_EXISTS)"
set aux 13
}
send "1118 91 12\n"
simple_expect "=1118 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { $aux 14 7 $any_time 00000000 1 [holl "1"] }"
# Attempt to remove one faq-text and add back two instances of the same faq-text.
send "1119 93 12 1 { $aux } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "1"] }\n"
extracting_expect "%1119 68 ($any_num)" dupaux 1
set test "correct aux-item flagged as duplicate when adding back two instances of the same faq-text"
if {$dupaux == 1} {
pass "$test"
} else {
if {$dupaux == 0} {
setup_xfail "*-*-*" "Bug 1615"
}
fail "$test (got $dupaux instead of 1)"
}
unset test
send "1120 91 12\n"
simple_expect "=1120 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { $aux 14 7 $any_time 00000000 1 [holl "1"] }"
# Remove the faq-text. Then, attempt to add it two identical faq-texts at once.
send "1121 93 12 1 { $aux } 0 { }\n"
simple_expect "=1121"
send "1122 93 12 0 { } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "1"] }\n"
extracting_expect "%1122 68 ($any_num)" dupaux 1
set test "correct aux-item flagged as duplicate when adding two identixal faq-texts"
if {$dupaux == 1} {
pass "$test"
} else {
if {$dupaux == 0} {
setup_xfail "*-*-*" "Bug 1615"
}
fail "$test (got $dupaux instead of 1)"
}
unset test
send "1123 91 12\n"
simple_expect "=1123 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 0 \\*"
# Add two faq-texts in a single operation. One points to an non-existing text.
send "1124 93 12 0 { } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "2"] }\n"
simple_expect "%1124 69 1"
send "1125 93 12 0 { } 2 { 14 00000000 1 [holl "2"] 14 00000000 1 [holl "1"] }\n"
simple_expect "%1125 69 0"
# Create text 2
send "1126 86 [holl "Text 2"] 1 { 0 12 } 0 { }\n"
simple_expect "=1126 2"
# Add two faq-texts in a single operation.
send "1127 93 12 0 { } 2 { 14 00000000 1 [holl "2"] 14 00000000 1 [holl "1"] }\n"
simple_expect "=1127"
# Check that Conference 12 and texts 1 and 2 looks OK.
send "1128 91 12\n"
simple_expect "=1128 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 2 0 2 { [expr {$aux + 1}] 14 7 $any_time 00000000 1 [holl "2"] [expr {$aux + 2}] 14 7 $any_time 00000000 1 [holl "1"] }"
send "1129 90 1\n"
simple_expect "=1129 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 8 28 7 $any_time 00001000 0 [holl "12"] }"
send "1130 90 2\n"
simple_expect "=1130 $any_time 7 0 6 0 2 { 0 12 6 2 } 1 { 1 28 7 $any_time 00001000 0 [holl "12"] }"
#
......@@ -544,41 +636,41 @@ simple_expect "=1105 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 0000
#
talk_to client 6
send "1113 55 0\n"
simple_expect "=1113"
send "1131 55 0\n"
simple_expect "=1131"
client_death 6
talk_to client 5
send "1114 55 0\n"
simple_expect "=1114"
send "1132 55 0\n"
simple_expect "=1132"
client_death 5
talk_to client 4
send "1115 55 0\n"
simple_expect "=1115"
send "1133 55 0\n"