Add connection test for smtpout.secureserver.net
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/test/test.c b/test/test.c
index 418c65b..885c7ad 100644
--- a/test/test.c
+++ b/test/test.c
@@ -4713,7 +4713,7 @@ test_all_failure_modes(void){
* - Multiple recipients
*/
static void
-smtp_func_test_postfix(void){
+smtp_func_test_server_postfix(void){
int rc;
rc = smtp_test_config_load_from_file("test/config/postfix.txt");
@@ -4737,6 +4737,44 @@ smtp_func_test_postfix(void){
smtp_func_test_all_html();
}
+/**
+ * Open and close a connection to secureserver.net.
+ */
+static void
+smtp_func_test_server_secureserver(void){
+ const char *const server = "smtpout.secureserver.net";
+ const char *port;
+ enum smtp_connection_security conn_security;
+ struct smtp *smtp;
+ unsigned int connection_i;
+ unsigned int i;
+
+ for(connection_i = 0; connection_i < 2; connection_i++){
+ if(connection_i == 0){
+ port = "25";
+ conn_security = SMTP_SECURITY_STARTTLS;
+ }
+ else{
+ port = "465";
+ conn_security = SMTP_SECURITY_TLS;
+ }
+ for(i = 0; i < 4; i++){
+ fprintf(stderr, "%s: %s: %u\n", server, port, i + 1);
+ g_rc = smtp_open(server,
+ port,
+ conn_security,
+ SMTP_DEBUG,
+ NULL,
+ &smtp);
+ assert(g_rc == SMTP_STATUS_OK);
+
+ g_rc = smtp_close(smtp);
+ assert(g_rc == SMTP_STATUS_OK);
+
+ smtp_test_sleep(1);
+ }
+ }
+}
/**
* Send attachment to test gmail account.
@@ -4789,7 +4827,7 @@ smtp_func_test_gmail_attachment(void){
* have been designed to work with a local postfix server instance.
*/
static void
-smtp_func_test_gmail(void){
+smtp_func_test_server_gmail(void){
int rc;
rc = smtp_test_config_load_from_file("test/config/gmail.txt");
@@ -4812,8 +4850,9 @@ smtp_func_test_gmail(void){
*/
static void
smtp_func_test_all(void){
- smtp_func_test_gmail();
- smtp_func_test_postfix();
+ smtp_func_test_server_secureserver();
+ smtp_func_test_server_gmail();
+ smtp_func_test_server_postfix();
}
/**