summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2012-10-22 08:59:24 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-30 08:39:49 (GMT)
commit3e0b0599d8ccc182f905eca753f80d9486e90a93 (patch)
treeee8de9ebba238fa3cdcd393b0144201318c6efd8 /tests
parent4555321da9b7cd7343bf4f2782c217f077212e84 (diff)
downloadQt-3e0b0599d8ccc182f905eca753f80d9486e90a93.zip
Qt-3e0b0599d8ccc182f905eca753f80d9486e90a93.tar.gz
Qt-3e0b0599d8ccc182f905eca753f80d9486e90a93.tar.bz2
Fix Qt network autotests against updated autotest server.
There is an updated version of Cyrus server available in Ubuntu 10.04 repositories. Installing autotest server now with puppet configs, results updated Cyrus server to be installed and "greetings" line it provides is not compatible with Qt 4.8 autotests. Use functions from qtbase, they don't require exact version of Cyrus. Change-Id: I4fd2f14ca9d51a992c129d2fcd9a6cc85fa10a1b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network-settings.h71
1 files changed, 7 insertions, 64 deletions
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 9038b9a..7612bf4 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -151,37 +151,12 @@ public:
static bool compareReplyIMAP(QByteArray const& actual)
{
- QList<QByteArray> expected;
-
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("imap.expectedreply")) {
- QtNetworkSettingsRecord* entry = entries["imap.expectedreply"];
- if(imapExpectedReply.isNull()) {
- imapExpectedReply = entry->recordValue().toAscii();
- imapExpectedReply.append('\r').append('\n');
- }
- expected << imapExpectedReply.data();
- }
-#endif
-
- // Mandriva; old test server
- expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " )
- .append(QtNetworkSettings::serverName().toAscii())
- .append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
- // Ubuntu 10.04; new test server
- expected << QByteArray( "* OK " )
- .append(QtNetworkSettings::serverLocalName().toAscii())
- .append(" Cyrus IMAP4 v2.2.13-Debian-2.2.13-19 server ready\r\n");
-
- // Feel free to add more as needed
-
- Q_FOREACH (QByteArray const& ba, expected) {
- if (ba == actual) {
- return true;
- }
+ // Server greeting may contain capability, version and server name
+ // But spec only requires "* OK" and "\r\n"
+ // Match against a prefix and postfix that covers all Cyrus versions
+ if (actual.startsWith("* OK ")
+ && actual.endsWith("server ready\r\n")) {
+ return true;
}
return false;
@@ -189,39 +164,7 @@ public:
static bool compareReplyIMAPSSL(QByteArray const& actual)
{
- QList<QByteArray> expected;
-
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("imap.expectedreplyssl")) {
- QtNetworkSettingsRecord* entry = entries["imap.expectedreplyssl"];
- if(imapExpectedReplySsl.isNull()) {
- imapExpectedReplySsl = entry->recordValue().toAscii();
- imapExpectedReplySsl.append('\r').append('\n');
- }
- expected << imapExpectedReplySsl.data();
- }
-#endif
- // Mandriva; old test server
- expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " )
- .append(QtNetworkSettings::serverName().toAscii())
- .append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
- // Ubuntu 10.04; new test server
- expected << QByteArray( "* OK " )
- .append(QtNetworkSettings::serverLocalName().toAscii())
- .append(" Cyrus IMAP4 v2.2.13-Debian-2.2.13-19 server ready\r\n");
-
- // Feel free to add more as needed
-
- Q_FOREACH (QByteArray const& ba, expected) {
- if (ba == actual) {
- return true;
- }
- }
-
- return false;
+ return compareReplyIMAP(actual);
}
static bool compareReplyFtp(QByteArray const& actual)