Commit ccaa3eb3 authored by Aard's avatar Aard

Rename rndssucli to ssucli, drop compat symlinks

The ssu CLI has been non-RnD specific for ages, get rid
of some more legacy stuff
parent e3e6f4a4
......@@ -30,7 +30,6 @@ Requires: ssu-network-proxy
%files
%defattr(-,root,root,-)
%{_libdir}/zypp/plugins/urlresolver/*
%{_bindir}/rndssu
%{_bindir}/ssu
%{_libdir}/libssu.so.*
%dir %{_sysconfdir}/zypp/credentials.d
......@@ -148,7 +147,6 @@ cd .. && doxygen doc/Doxyfile
%install
cd build && make INSTALL_ROOT=%{buildroot} install
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
ln -s %{_bindir}/ssu %{buildroot}/%{_bindir}/rndssu
mkdir -p %{buildroot}/%{_docdir}/%{name}
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
......
......@@ -4,7 +4,7 @@ contains(QT_VERSION, ^4\\.[0-7]\\..*) {
TEMPLATE = subdirs
SUBDIRS = libssu libssunetworkproxy ssud
SUBDIRS += rndssucli ssuurlresolver ssuks
SUBDIRS += ssucli ssuurlresolver ssuks
ssuconfhack {
SUBDIRS += ssuconfperm
......@@ -12,7 +12,7 @@ ssuconfhack {
SUBDIRS += tests tools
rndssucli.depends = libssu
ssucli.depends = libssu
rndregisterui.depends = libssu
ssuurlresolver.depends = libssu
tests.depends = libssu
......@@ -40,5 +40,5 @@ system(qdbusxml2cpp \
system(qdbusxml2cpp \
-c SsuProxy \
-p rndssucli/ssuproxy.h:rndssucli/ssuproxy.cpp \
-p ssucli/ssuproxy.h:ssucli/ssuproxy.cpp \
dbus/org.nemo.ssu.xml)
......@@ -11,13 +11,13 @@
#include <QLibraryInfo>
#include <QTimer>
#include "libssunetworkproxy/ssunetworkproxy.h"
#include "rndssucli.h"
#include "ssucli.h"
int main(int argc, char** argv){
QCoreApplication app(argc, argv);
QCoreApplication::setOrganizationName("Jolla");
QCoreApplication::setOrganizationDomain("http://www.jollamobile.com");
QCoreApplication::setApplicationName("rndssu");
QCoreApplication::setApplicationName("ssu");
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(),
......@@ -26,7 +26,7 @@ int main(int argc, char** argv){
set_application_proxy_factory();
RndSsuCli mw;
SsuCli mw;
QTimer::singleShot(0, &mw, SLOT(run()));
return app.exec();
......
/**
* @file rndssucli.cpp
* @file ssucli.cpp
* @copyright 2012 Jolla Ltd.
* @author Bernd Wachter <bernd.wachter@jollamobile.com>
* @date 2012
......@@ -16,9 +16,9 @@
#include <QDebug>
#include "rndssucli.h"
#include "ssucli.h"
RndSsuCli::RndSsuCli(): QObject(){
SsuCli::SsuCli(): QObject(){
connect(this,SIGNAL(done()),
QCoreApplication::instance(),SLOT(quit()), Qt::DirectConnection);
connect(&ssu, SIGNAL(done()),
......@@ -32,11 +32,11 @@ RndSsuCli::RndSsuCli(): QObject(){
state = Idle;
}
RndSsuCli::~RndSsuCli(){
SsuCli::~SsuCli(){
ssuProxy->quit();
}
void RndSsuCli::handleResponse(){
void SsuCli::handleResponse(){
QTextStream qout(stdout);
if (ssu.error()){
......@@ -48,7 +48,7 @@ void RndSsuCli::handleResponse(){
}
}
void RndSsuCli::handleDBusResponse(){
void SsuCli::handleDBusResponse(){
QTextStream qout(stdout);
if (ssuProxy->error()){
......@@ -60,7 +60,7 @@ void RndSsuCli::handleDBusResponse(){
}
}
void RndSsuCli::optDomain(QStringList opt){
void SsuCli::optDomain(QStringList opt){
QTextStream qout(stdout);
if (opt.count() == 3 && opt.at(2) == "-s"){
......@@ -78,7 +78,7 @@ void RndSsuCli::optDomain(QStringList opt){
}
}
void RndSsuCli::optFlavour(QStringList opt){
void SsuCli::optFlavour(QStringList opt){
QTextStream qout(stdout);
QTextStream qerr(stderr);
......@@ -107,7 +107,7 @@ void RndSsuCli::optFlavour(QStringList opt){
}
}
void RndSsuCli::optMode(QStringList opt){
void SsuCli::optMode(QStringList opt){
QTextStream qout(stdout);
QTextStream qerr(stderr);
......@@ -156,7 +156,7 @@ void RndSsuCli::optMode(QStringList opt){
}
}
void RndSsuCli::optModel(QStringList opt){
void SsuCli::optModel(QStringList opt){
QTextStream qout(stdout);
QTextStream qerr(stderr);
SsuDeviceInfo deviceInfo;
......@@ -170,7 +170,7 @@ void RndSsuCli::optModel(QStringList opt){
}
}
void RndSsuCli::optModifyRepo(enum Actions action, QStringList opt){
void SsuCli::optModifyRepo(enum Actions action, QStringList opt){
SsuRepoManager repoManager;
QTextStream qout(stdout);
QTextStream qerr(stderr);
......@@ -229,7 +229,7 @@ void RndSsuCli::optModifyRepo(enum Actions action, QStringList opt){
}
}
void RndSsuCli::optRegister(QStringList opt){
void SsuCli::optRegister(QStringList opt){
/*
* register a new device
*/
......@@ -271,7 +271,7 @@ void RndSsuCli::optRegister(QStringList opt){
state = Busy;
}
void RndSsuCli::optRelease(QStringList opt){
void SsuCli::optRelease(QStringList opt){
QTextStream qout(stdout);
QTextStream qerr(stderr);
......@@ -320,7 +320,7 @@ void RndSsuCli::optRelease(QStringList opt){
}
}
void RndSsuCli::optRepos(QStringList opt){
void SsuCli::optRepos(QStringList opt){
QTextStream qout(stdout);
SsuRepoManager repoManager;
SsuDeviceInfo deviceInfo;
......@@ -468,7 +468,7 @@ void RndSsuCli::optRepos(QStringList opt){
state = Idle;
}
void RndSsuCli::optStatus(QStringList opt){
void SsuCli::optStatus(QStringList opt){
QTextStream qout(stdout);
QTextStream qerr(stderr);
SsuDeviceInfo deviceInfo;
......@@ -501,7 +501,7 @@ void RndSsuCli::optStatus(QStringList opt){
qout << "Release: " << ssu.release() << endl;
}
void RndSsuCli::optUpdateCredentials(QStringList opt){
void SsuCli::optUpdateCredentials(QStringList opt){
QTextStream qout(stdout);
/*
* update the credentials
......@@ -521,7 +521,7 @@ void RndSsuCli::optUpdateCredentials(QStringList opt){
}
}
void RndSsuCli::optUpdateRepos(QStringList opt){
void SsuCli::optUpdateRepos(QStringList opt){
QTextStream qerr(stdout);
QDBusPendingReply<> reply = ssuProxy->updateRepos();
......@@ -534,7 +534,7 @@ void RndSsuCli::optUpdateRepos(QStringList opt){
}
}
void RndSsuCli::run(){
void SsuCli::run(){
QTextStream qout(stdout);
QTextStream qerr(stderr);
......@@ -544,9 +544,6 @@ void RndSsuCli::run(){
if (!ssuSettings->isWritable())
qerr << "WARNING: ssu.ini does not seem to be writable. Setting values might not work." << endl;
if (arguments.at(0).endsWith("rndssu"))
qout << "NOTE: this binary is now called ssu. The rndssu symlink will go away after some time" << endl;
// make sure there's a first argument to parse
if (arguments.count() < 2){
usage();
......@@ -558,28 +555,28 @@ void RndSsuCli::run(){
const char *shortopt; // option shortcut name
int minargs; // minimum number of required args
int maxargs; // -1 for "function will handle max args"
void (RndSsuCli::*handler)(QStringList opt); // handler function
void (SsuCli::*handler)(QStringList opt); // handler function
} handlers[] = {
// functions accepting no additional arguments
"status", "s", 0, 0, &RndSsuCli::optStatus,
"updaterepos", "ur", 0, 0, &RndSsuCli::optUpdateRepos,
"status", "s", 0, 0, &SsuCli::optStatus,
"updaterepos", "ur", 0, 0, &SsuCli::optUpdateRepos,
// functions requiring at least one argument
"addrepo", "ar", 1, 2, &RndSsuCli::optAddRepo,
"removerepo", "rr", 1, 1, &RndSsuCli::optRemoveRepo,
"enablerepo", "er", 1, 1, &RndSsuCli::optEnableRepo,
"disablerepo", "dr", 1, 1, &RndSsuCli::optDisableRepo,
"addrepo", "ar", 1, 2, &SsuCli::optAddRepo,
"removerepo", "rr", 1, 1, &SsuCli::optRemoveRepo,
"enablerepo", "er", 1, 1, &SsuCli::optEnableRepo,
"disablerepo", "dr", 1, 1, &SsuCli::optDisableRepo,
// functions accepting 0 or more arguments
// those need to set state to Idle on success
"register", "r", 0, -1, &RndSsuCli::optRegister,
"repos", "lr", 0, -1, &RndSsuCli::optRepos,
"flavour", "fl", 0, -1, &RndSsuCli::optFlavour,
"mode", "m", 0, -1, &RndSsuCli::optMode,
"model", "mo", 0, -1, &RndSsuCli::optModel,
"release", "re", 0, -1, &RndSsuCli::optRelease,
"update", "up", 0, -1, &RndSsuCli::optUpdateCredentials,
"domain", "do", 0, -1, &RndSsuCli::optDomain,
"register", "r", 0, -1, &SsuCli::optRegister,
"repos", "lr", 0, -1, &SsuCli::optRepos,
"flavour", "fl", 0, -1, &SsuCli::optFlavour,
"mode", "m", 0, -1, &SsuCli::optMode,
"model", "mo", 0, -1, &SsuCli::optModel,
"release", "re", 0, -1, &SsuCli::optRelease,
"update", "up", 0, -1, &SsuCli::optUpdateCredentials,
"domain", "do", 0, -1, &SsuCli::optDomain,
};
bool found = false;
......@@ -619,7 +616,7 @@ void RndSsuCli::run(){
usage();
}
void RndSsuCli::uidWarning(QString message){
void SsuCli::uidWarning(QString message){
if (message.isEmpty())
message = "Run 'ssu ur' as root to recreate repository files";
......@@ -629,7 +626,7 @@ void RndSsuCli::uidWarning(QString message){
}
}
void RndSsuCli::usage(QString message){
void SsuCli::usage(QString message){
QTextStream qout(stderr);
qout << "\nUsage: ssu <command> [-command-options] [arguments]" << endl
<< endl
......
/**
* @file rndssucli.h
* @file ssucli.h
* @copyright 2012 Jolla Ltd.
* @author Bernd Wachter <bernd.wachter@jollamobile.com>
* @date 2012
*/
#ifndef _RndSsuCli_H
#define _RndSsuCli_H
#ifndef _SsuCli_H
#define _SsuCli_H
#include <QObject>
#include <QSettings>
......@@ -16,12 +16,12 @@
#include "libssu/ssu.h"
#include "ssuproxy.h"
class RndSsuCli: public QObject {
class SsuCli: public QObject {
Q_OBJECT
public:
RndSsuCli();
~RndSsuCli();
SsuCli();
~SsuCli();
public slots:
void run();
......
TARGET = ssu
include(../ssuapplication.pri)
include(rndssucli_dependencies.pri)
include(ssucli_dependencies.pri)
QT += network dbus
CONFIG += link_pkgconfig
HEADERS = rndssucli.h \
HEADERS = ssucli.h \
ssuproxy.h
SOURCES = main.cpp \
rndssucli.cpp \
ssucli.cpp \
ssuproxy.cpp
/*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -c SsuProxy -p ssucli/ssuproxy.h:ssucli/ssuproxy.cpp dbus/org.nemo.ssu.xml
*
* qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
* before re-generating it.
*/
#include "ssucli/ssuproxy.h"
/*
* Implementation of interface class SsuProxy
*/
SsuProxy::SsuProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
{
}
SsuProxy::~SsuProxy()
{
}
/*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -c SsuProxy -p ssucli/ssuproxy.h:ssucli/ssuproxy.cpp dbus/org.nemo.ssu.xml
*
* qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
#ifndef SSUPROXY_H_1383958410
#define SSUPROXY_H_1383958410
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
/*
* Proxy class for interface org.nemo.ssu
*/
class SsuProxy: public QDBusAbstractInterface
{
Q_OBJECT
public:
static inline const char *staticInterfaceName()
{ return "org.nemo.ssu"; }
public:
SsuProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
~SsuProxy();
public Q_SLOTS: // METHODS
inline QDBusPendingReply<> addRepo(const QString &repo, const QString &url)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(repo) << QVariant::fromValue(url);
return asyncCallWithArgumentList(QLatin1String("addRepo"), argumentList);
}
inline QDBusPendingReply<QString> deviceFamily()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("deviceFamily"), argumentList);
}
inline QDBusPendingReply<int> deviceMode()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("deviceMode"), argumentList);
}
inline QDBusPendingReply<QString> deviceModel()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("deviceModel"), argumentList);
}
inline QDBusPendingReply<QString> deviceUid()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("deviceUid"), argumentList);
}
inline QDBusPendingReply<QString> deviceVariant()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("deviceVariant"), argumentList);
}
inline QDBusPendingReply<QString> displayName(int type)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(type);
return asyncCallWithArgumentList(QLatin1String("displayName"), argumentList);
}
inline QDBusPendingReply<bool> error()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("error"), argumentList);
}
inline QDBusPendingReply<QString> flavour()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("flavour"), argumentList);
}
inline QDBusPendingReply<bool> isRegistered()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("isRegistered"), argumentList);
}
inline QDBusPendingReply<QString> lastError()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("lastError"), argumentList);
}
inline QDBusPendingReply<> modifyRepo(int action, const QString &repo)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(action) << QVariant::fromValue(repo);
return asyncCallWithArgumentList(QLatin1String("modifyRepo"), argumentList);
}
inline QDBusPendingReply<> quit()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("quit"), argumentList);
}
inline QDBusPendingReply<> registerDevice(const QString &username, const QString &password)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(username) << QVariant::fromValue(password);
return asyncCallWithArgumentList(QLatin1String("registerDevice"), argumentList);
}
inline QDBusPendingReply<QString> release(bool rnd)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(rnd);
return asyncCallWithArgumentList(QLatin1String("release"), argumentList);
}
inline QDBusPendingReply<> setDeviceMode(int mode)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(mode);
return asyncCallWithArgumentList(QLatin1String("setDeviceMode"), argumentList);
}
inline QDBusPendingReply<> setFlavour(const QString &flavour)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(flavour);
return asyncCallWithArgumentList(QLatin1String("setFlavour"), argumentList);
}
inline QDBusPendingReply<> setRelease(const QString &release, bool rnd)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(release) << QVariant::fromValue(rnd);
return asyncCallWithArgumentList(QLatin1String("setRelease"), argumentList);
}
inline QDBusPendingReply<> unregisterDevice()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("unregisterDevice"), argumentList);
}
inline QDBusPendingReply<> updateRepos()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QLatin1String("updateRepos"), argumentList);
}
Q_SIGNALS: // SIGNALS
void credentialsChanged();
void done();
void registrationStatusChanged();
};
namespace org {
namespace nemo {
typedef ::SsuProxy ssu;
}
}
#endif
......@@ -6,7 +6,7 @@ SUBDIRS = \
ut_coreconfig \
ut_deviceinfo \
ut_repomanager \
ut_rndssucli \
ut_ssucli \
ut_sandbox \
ut_settings \
ut_ssuurlresolver \
......
......@@ -18,9 +18,9 @@
<step expected_result="0">/opt/tests/ssu/runtest.sh ut_repomanager</step>
</case>
</set>
<set name="rndssucli" description="Test to determine if ssu command line tool works properly" feature="rndssucli">
<case name="ut_rndssucli" type="Functional" description="SSU command line utility test" timeout="1000" subfeature="">
<step expected_result="0">/opt/tests/ssu/runtest.sh ut_rndssucli</step>
<set name="ssucli" description="Test to determine if ssu command line tool works properly" feature="ssucli">
<case name="ut_ssucli" type="Functional" description="SSU command line utility test" timeout="1000" subfeature="">
<step expected_result="0">/opt/tests/ssu/runtest.sh ut_ssucli</step>
</case>
</set>
<set name="sandbox" description="Test to determine if sandboxing works properly" feature="sandbox">
......
......@@ -7,12 +7,12 @@
#include <QtTest/QtTest>
#include "rndssuclitest.h"
#include "ssuclitest.h"
int main(int argc, char **argv){
RndSsuCliTest rndSsuCliTest;
SsuCliTest ssuCliTest;
if (QTest::qExec(&rndSsuCliTest, argc, argv))
if (QTest::qExec(&ssuCliTest, argc, argv))
return 1;
return 0;
......
/**
* @file rndssuclitest.cpp
* @file ssuclitest.cpp
* @copyright 2013 Jolla Ltd.
* @author Martin Kampas <martin.kampas@tieto.com>
* @date 2013
*/
#include "rndssuclitest.h"
#include "ssuclitest.h"
#include <stdlib.h>
#include <zypp/media/UrlResolverPlugin.h>
......@@ -17,7 +17,7 @@
typedef QStringList Args; // improve readability
void RndSsuCliTest::init(){
void SsuCliTest::init(){
Q_ASSERT(m_sandbox == 0);
m_sandbox = new Sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
......@@ -44,7 +44,7 @@ void RndSsuCliTest::init(){
}
}
void RndSsuCliTest::cleanup(){
void SsuCliTest::cleanup(){
if (m_ssud->state() != QProcess::Running){
QFAIL("Sandboxed ssud instance exited unexpectedly");
}
......@@ -63,7 +63,7 @@ void RndSsuCliTest::cleanup(){
m_sandbox = 0;
}
void RndSsuCliTest::testSubcommandFlavour(){
void SsuCliTest::testSubcommandFlavour(){
Process ssu;
QString output;
......@@ -86,7 +86,7 @@ void RndSsuCliTest::testSubcommandFlavour(){
QCOMPARE(output, QString("Device flavour is currently: testing"));
}
void RndSsuCliTest::testSubcommandRelease(){
void SsuCliTest::testSubcommandRelease(){
Process ssu;
QString output;
......@@ -139,7 +139,7 @@ void RndSsuCliTest::testSubcommandRelease(){
QCOMPARE(output, QString("Device mode is: 2 (RndMode)"));
}
void RndSsuCliTest::testSubcommandMode(){
void SsuCliTest::testSubcommandMode(){
Process ssu;
QString output;
......
/**
* @file rndssuclitest.h
* @file ssuclitest.h
* @copyright 2013 Jolla Ltd.
* @author Martin Kampas <martin.kampas@tieto.com>
* @date 2013
*/
#ifndef _RNDSSUCLITEST_H
#define _RNDSSUCLITEST_H
#ifndef _SSUCLITEST_H
#define _SSUCLITEST_H
#include <QObject>
......@@ -14,11 +14,11 @@ class QProcess;
class Sandbox;
class RndSsuCliTest: public QObject {
class SsuCliTest: public QObject {
Q_OBJECT
public:
RndSsuCliTest(): m_sandbox(0) {}
SsuCliTest(): m_sandbox(0) {}
private slots:
void init();
......
TARGET = ut_rndssucli
TARGET = ut_ssucli
include(../testapplication.pri)
include(ut_rndssucli_dependencies.pri)
include(ut_ssucli_dependencies.pri)
HEADERS = \
rndssuclitest.h \
ssuclitest.h \
SOURCES = \
main.cpp \
rndssuclitest.cpp \
ssuclitest.cpp \
test_data_etc.files = \
testdata/ssu.ini \
testdata/ssu.ini \
test_data_usr_share.files = \
testdata/ssu-defaults.ini \
testdata/repos.ini \
testdata/board-mappings.ini \
testdata/ssu-defaults.ini \
testdata/repos.ini \
testdata/board-mappings.ini \
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment