summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
diff options
context:
space:
mode:
authorXizhi Zhu <xizhi.zhu@gmail.com>2012-01-10 04:41:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-10 07:12:41 +0100
commit0e0eb207c4ada7a09c980b816dda1c5c6af1c027 (patch)
treed41d6bf33a917b00e70cb78d87b297a0f823274c /tests/auto/network
parent67f4893b7155799c529369880d59c314210149de (diff)
Remove ICD plugin for bearer.
It's only used by Maemo and Harmattan, thus not needed in Qt5. Change-Id: I8638f4fc63637be88d1aa584cde7e3a4116f2de6 Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'tests/auto/network')
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro6
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp118
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro6
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp128
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/test.pro6
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp108
6 files changed, 1 insertions, 371 deletions
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro b/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
index b01f8d380e..cde82a4fb2 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
+++ b/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
@@ -4,9 +4,3 @@ SOURCES += tst_qnetworkconfiguration.cpp
HEADERS += ../qbearertestcommon.h
QT = core network testlib
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index 8746211bf5..6efcfe3b7a 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -52,136 +52,18 @@
*/
#include <QNetworkAccessManager>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
-#endif
-
QT_USE_NAMESPACE
class tst_QNetworkConfiguration : public QObject
{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
-
private slots:
void invalidPoint();
void comparison();
void children();
void isRoamingAvailable();
-
-private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 50
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
-#endif
};
-void tst_QNetworkConfiguration::initTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-}
-
-void tst_QNetworkConfiguration::cleanupTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- // Terminate icd2 stub
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
-}
-
void tst_QNetworkConfiguration::invalidPoint()
{
QNetworkConfiguration pt;
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
index e7ff28ee63..52cee1f64d 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
@@ -4,9 +4,3 @@ SOURCES += tst_qnetworkconfigurationmanager.cpp
HEADERS += ../qbearertestcommon.h
QT = core network testlib
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index ff980caae2..77e16161e6 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -45,146 +45,18 @@
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
-#endif
-
QT_USE_NAMESPACE
class tst_QNetworkConfigurationManager : public QObject
{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
void usedInThread(); // this test must be first, or it will falsely pass
void allConfigurations();
void defaultConfiguration();
void configurationFromIdentifier();
-
-private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 50
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
-#endif
};
-void tst_QNetworkConfigurationManager::initTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-}
-
-
-void tst_QNetworkConfigurationManager::cleanupTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
-}
-
-void tst_QNetworkConfigurationManager::init()
-{
-}
-
-void tst_QNetworkConfigurationManager::cleanup()
-{
-}
-
void printConfigurationDetails(const QNetworkConfiguration& p)
{
qDebug() << p.name() <<": isvalid->" <<p.isValid() << " type->"<< p.type() <<
diff --git a/tests/auto/network/bearer/qnetworksession/test/test.pro b/tests/auto/network/bearer/qnetworksession/test/test.pro
index ad55a4223b..5567e35b02 100644
--- a/tests/auto/network/bearer/qnetworksession/test/test.pro
+++ b/tests/auto/network/bearer/qnetworksession/test/test.pro
@@ -14,9 +14,3 @@ CONFIG(debug_and_release) {
} else {
DESTDIR = ..
}
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
index 544d3782a2..76fbac3368 100644
--- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
@@ -48,18 +48,13 @@
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
-#endif
-
QT_USE_NAMESPACE
// Can be used to configure tests that require manual attention (such as roaming)
//#define QNETWORKSESSION_MANUAL_TESTS 1
Q_DECLARE_METATYPE(QNetworkConfiguration)
-Q_DECLARE_METATYPE(QNetworkConfiguration::Type);
+Q_DECLARE_METATYPE(QNetworkConfiguration::Type)
class tst_QNetworkSession : public QObject
{
@@ -97,15 +92,6 @@ private slots:
private:
QNetworkConfigurationManager manager;
int inProcessSessionManagementCount;
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 10
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
-#endif
};
// Helper functions
@@ -120,76 +106,6 @@ void tst_QNetworkSession::initTestCase()
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
qRegisterMetaType<QNetworkConfiguration::Type>("QNetworkConfiguration::Type");
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-
inProcessSessionManagementCount = -1;
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
@@ -205,28 +121,6 @@ void tst_QNetworkSession::cleanupTestCase()
qWarning("No usable configurations found to complete all possible tests in "
"inProcessSessionManagement()");
}
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
}
// Robustness test for calling interfaces in nonsense order / with nonsense parameters