ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/testsuite/tclient/register
Revision: 1.2
Committed: Mon Oct 25 02:50:17 2010 UTC (15 years, 11 months ago) by sf-pippijn
Branch: MAIN
Changes since 1.1: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 sf-pippijn 1.1 #!/usr/bin/env perl
2    
3     use common::sense;
4    
5     use Expect;
6    
7     use constant {
8     TIMEOUT => 5,
9     };
10    
11     my $exp = new Expect;
12    
13     sub expect {
14     die "unexpected response or timeout"
15     unless $exp->expect (TIMEOUT, @_)
16     }
17    
18     sub process {
19     $exp->send ("$_[0]\n")
20     }
21    
22    
23     $exp->spawn ("$ENV{builddir}/tclient", $ENV{testserver}, $ENV{testport});
24    
25     expect "What is your name?";
26     process "/reply testuser$$";
27    
28     expect "What is your password?";
29     process "/reply testpass";
30    
31     expect "Please type your password again.";
32     process "/reply testpass";
33    
34     for (0 .. 10) {
35     expect "Roll again";
36     process "/reply y";
37     }
38     expect "Roll again";
39     process "/reply n";
40    
41     for (0 .. 10) {
42     expect "Press any key to change outlook";
43     process "/reply n";
44     }
45     expect "Press any key to change outlook";
46     process "/reply d";
47    
48     expect "Press 'f' to become female";
49     process "/reply m";
50    
51     expect "Welcome to Deliantra!";
52 sf-pippijn 1.2 # dump-map is immediate, so we don't need to expect anything
53     # just look at the log if you are interested
54 sf-pippijn 1.1 process "!dump-map";
55     process "quit_character";
56    
57     expect "PERMANENTLY";
58     process "/reply y";
59    
60     expect "Ok, quitting";
61     expect "EOF from server";
62    
63     $exp->soft_close