[exim-cvs] Testcase for udpsend

Etusivu
Poista viesti
Vastaa
Lähettäjä: Exim Git Commits Mailing List
Päiväys:  
Vastaanottaja: exim-cvs
Aihe: [exim-cvs] Testcase for udpsend
Gitweb: http://git.exim.org/exim.git/commitdiff/f77cff22db0bbb4d71a16becb5512e19d86ed63a
Commit:     f77cff22db0bbb4d71a16becb5512e19d86ed63a
Parent:     c50e5871c141ea24777fc916de1fc0cb2e96c37d
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Jun 8 17:49:21 2014 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Jun 8 17:49:21 2014 +0100


    Testcase for udpsend
---
 test/aux-fixed/0601.udpserver |   22 ++++++++++++++++++++++
 test/confs/0601               |   20 ++++++++++++++++++++
 test/log/0601                 |    1 +
 test/rejectlog/0601           |    1 +
 test/scripts/0000-Basic/0601  |   16 ++++++++++++++++
 test/stdout/0601              |    2 ++
 6 files changed, 62 insertions(+), 0 deletions(-)


diff --git a/test/aux-fixed/0601.udpserver b/test/aux-fixed/0601.udpserver
new file mode 100644
index 0000000..5513402
--- /dev/null
+++ b/test/aux-fixed/0601.udpserver
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use IO::Socket::INET;
+use IO::Select;
+
+if (fork != 0) {
+  sleep 1;
+  exit 0;
+}
+
+my ($select,$socket,$received_data);
+
+$socket = new IO::Socket::INET (
+  LocalPort => '1223',
+  Proto => 'udp',
+) or die "ERROR in Socket Creation : $!\n";
+
+$select = IO::Select->new($socket) or die "IO::Select $!";
+
+if (scalar ($select->can_read(5)) == 1) {
+    $socket->recv($recieved_data,1024);
+    print "received: $recieved_data\n";
+}
diff --git a/test/confs/0601 b/test/confs/0601
new file mode 100644
index 0000000..58b47d5
--- /dev/null
+++ b/test/confs/0601
@@ -0,0 +1,20 @@
+# Exim test configuration 0601
+# udpsend
+
+exim_path = EXIM_PATH
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+
+# ----- Main settings -----
+
+acl_smtp_connect = check
+
+
+# ----- ACL -----
+
+begin acl
+
+check:
+  warn    udpsend = <; 127.0.0.1 ; 1223 ; message from exim
+
+# End
diff --git a/test/log/0601 b/test/log/0601
new file mode 100644
index 0000000..1d4157f
--- /dev/null
+++ b/test/log/0601
@@ -0,0 +1 @@
+1999-03-02 09:44:33 U=CALLER rejected connection in "connect" ACL
diff --git a/test/rejectlog/0601 b/test/rejectlog/0601
new file mode 100644
index 0000000..1d4157f
--- /dev/null
+++ b/test/rejectlog/0601
@@ -0,0 +1 @@
+1999-03-02 09:44:33 U=CALLER rejected connection in "connect" ACL
diff --git a/test/scripts/0000-Basic/0601 b/test/scripts/0000-Basic/0601
new file mode 100644
index 0000000..c126c06
--- /dev/null
+++ b/test/scripts/0000-Basic/0601
@@ -0,0 +1,16 @@
+# udpsend
+#need_ipv4
+#
+#
+perl aux-fixed/0601.udpserver
+****
+#
+exim -bs -odi
+mail from:someone@???
+rcpt to:CALLER@HOSTNAME
+data
+This is a test message.
+.
+quit
+***
+sleep 4
diff --git a/test/stdout/0601 b/test/stdout/0601
new file mode 100644
index 0000000..75968f3
--- /dev/null
+++ b/test/stdout/0601
@@ -0,0 +1,2 @@
+received:  message from exim
+550 Administrative prohibition