Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
d11e2990
...
d11e29902e92221b239efffa670a4c346da52f9a
authored
2002-11-04 17:36:15 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mailer_test): New procedure for testing mailers
1 parent
3e840c28
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
testsuite/lib/mailutils.exp
testsuite/lib/mailutils.exp
View file @
d11e299
...
...
@@ -71,11 +71,16 @@ proc mu_init {args} {
set MU_SPOOL_DIR
"
$
MU_DATA_DIR/spool"
set MU_FOLDER_DIR
"
$
MU_DATA_DIR/folder"
if
{[
llength
$args
]
== 1 &&
[
lindex
$args
0
]
==
"-noflags"
}
{
set MU_TOOL_FLAGS
""
}
else
{
set MU_TOOL_FLAGS
"--mail-spool
$
MU_SPOOL_DIR"
for
{
set
i 0
}
{
$i
<
[
llength
$args
]}
{
incr
i
}
{
append MU_TOOL_FLAGS
"
[
lindex
$args
$i
]
"
}
}
}
}
proc mu_start
{
args
}
{
...
...
@@ -672,4 +677,92 @@ proc mu_test_file {args} {
return
$result
}
# mailer_test
[
-message MESSAGE
][
-default
(
FAIL|XFAIL
)]
# [-file FILENAME
]
# [-input INPUT-LIST
]
# [-args ARGS
]
# [-pattern PATTERN-LIST
]
[
PATTERN...
]
# INPUT-LIST - List of input strings
# PATTERN - Sequence to expect in return.
# MESSAGE - [optional
]
message to output
#
# FIXME: Need -retcode option.
#
proc
mailer_test
{
args
}
{
global MU_TOOL
global MU_TOOL_FLAGS
global top_builddir
global verbose
global suppress_flag
;
upvar timeout timeout
set default
""
set message
""
set invocation
""
set input
""
set pattern
""
set filename
""
for
{
set
i 0
}
{
$i
<
[
llength
$args
]}
{
incr
i
}
{
set a
[
lindex
$args
$i
]
if
{
"
$a
"
==
"-default"
}
{
incr i
set default
[
lindex
$args
$i
]
}
else
if
{
"
$a
"
==
"-message"
}
{
incr i
set message
[
lindex
$args
$i
]
}
else
if
{
"
$a
"
==
"-file"
}
{
incr i
set filename
[
lindex
$args
$i
]
}
else
if
{
"
$a
"
==
"-pattern"
}
{
incr i
set pattern
[
lindex
$args
$i
]
}
else
if
{
"
$a
"
==
"-input"
}
{
incr i
set input
[
lindex
$args
$i
]
}
else
if
{
"
$a
"
==
"-args"
}
{
incr i
set a
[
lindex
$args
$i
]
if
{[
llength
$a
]
> 0
}
{
append invocation
$a
}
}
else
{
set args
[
lrange
$args
$i
end
]
break
}
}
if
{
$i
<
[
llength
$args
]}
{
lappend pattern
[
lrange
$args
$i
end
]
}
verbose
"Spawning
$
MU_TOOL
$
MU_TOOL_FLAGS
$invocation
"
1
set res
[
remote_spawn host
"
$
MU_TOOL
$
MU_TOOL_FLAGS
$invocation
"
]
if
{
$res
< 0 ||
$res
==
""
}
{
perror
"Spawning
$
MU_TOOL
$
MU_TOOL_FLAGS
$invocation
failed."
return 1
;
}
if
{
"
$message
"
==
""
}
{
set message
[
lindex
$args
0
]
}
if
$verbose
>2
then
{
send_user
"Message is
\"
$message
\"\n
"
}
set result
""
verbose
"INPUT:
$input
"
1
for
{
set
i 0
}
{
$result
==
""
&&
$i
<
[
llength
$input
]}
{
incr
i
}
{
set s
[
lindex
$input
$i
]
verbose
"SEND:
$s
"
1
set result
[
mu_send
"
[
lindex
$input
$i
]
\n
"
]
verbose
"RESULT:
$result
"
}
mu_send
""
remote_wait host 60
return
[
mu_test_file -default
$default
-message
$message
-pattern
$pattern
$filename
]
}
...
...
Please
register
or
sign in
to post a comment