Exemple #1
0
void TestNetctl::test_reenableProfile()
{
    Netctl *netctl = createNetctlObj();
    QList<QVariant> args;
    args.append(QString("netctlgui-test-dummy"));
    QVERIFY(!netctl->isProfileEnabled(QString("netctlgui-test-dummy")));
    if (helper) QVERIFY(!sendDBusRequest(QString("/netctl"), QString("isProfileEnabled"), args)[0].toBool());
    netctl->enableProfile(QString("netctlgui-test-dummy"));
    QVERIFY(netctl->isProfileEnabled(QString("netctlgui-test-dummy")));
    QVERIFY(netctl->reenableProfile(QString("netctlgui-test-dummy")));
    QVERIFY(netctl->isProfileEnabled(QString("netctlgui-test-dummy")));
    if (helper) {
        QVERIFY(sendDBusRequest(QString("/netctl"), QString("isProfileEnabled"), args)[0].toBool());
        QVERIFY(sendDBusRequest(QString("/ctrl"), QString("Reenable"), args)[0].toBool());
        QVERIFY(sendDBusRequest(QString("/netctl"), QString("isProfileEnabled"), args)[0].toBool());
    }
    netctl->enableProfile(QString("netctlgui-test-dummy"));
    delete netctl;
}