summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp')
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp108
1 files changed, 1 insertions, 107 deletions
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