Testcase for udpsend
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 8 Jun 2014 16:49:21 +0000 (17:49 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 8 Jun 2014 16:49:21 +0000 (17:49 +0100)
test/aux-fixed/0601.udpserver [new file with mode: 0644]
test/confs/0601 [new file with mode: 0644]
test/log/0601 [new file with mode: 0644]
test/rejectlog/0601 [new file with mode: 0644]
test/scripts/0000-Basic/0601 [new file with mode: 0644]
test/stdout/0601 [new file with mode: 0644]

diff --git a/test/aux-fixed/0601.udpserver b/test/aux-fixed/0601.udpserver
new file mode 100644 (file)
index 0000000..5513402
--- /dev/null
@@ -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 (file)
index 0000000..58b47d5
--- /dev/null
@@ -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 (file)
index 0000000..1d4157f
--- /dev/null
@@ -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 (file)
index 0000000..1d4157f
--- /dev/null
@@ -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 (file)
index 0000000..c126c06
--- /dev/null
@@ -0,0 +1,16 @@
+# udpsend
+#need_ipv4
+#
+#
+perl aux-fixed/0601.udpserver
+****
+#
+exim -bs -odi
+mail from:someone@some.domain
+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 (file)
index 0000000..75968f3
--- /dev/null
@@ -0,0 +1,2 @@
+received:  message from exim
+550 Administrative prohibition\r