/*
- * Copyright (c) 2016-2019 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
class ScopedInstaller {
public:
- ScopedInstaller(const AppInstallHelper &app, bool requestUid = true)
+ ScopedInstaller(const AppInstallHelper &app,
+ bool requestUid = true,
+ lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS)
: m_appIds({app.getAppId()}),
m_uid(app.getUID()),
m_installType(app.getInstallType()),
- m_shouldUninstall(true),
+ m_shouldUninstall(expectedResult == SECURITY_MANAGER_SUCCESS),
m_requestUid(requestUid),
m_creatorPid(getpid())
{
for (const auto &priv : app.getAppDefinedPrivileges())
instReq.addAppDefinedPrivilege(priv);
- SecurityManagerTest::Api::install(instReq);
+ SecurityManagerTest::Api::install(instReq, expectedResult);
}
ScopedInstaller(const std::vector<std::string> &appIds, const std::string &pkgId)