-
Notifications
You must be signed in to change notification settings - Fork 3
l1-friendtest #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
l1-friendtest #110
Changes from 250 commits
3dfd3f5
7ec2a8a
83d4fdd
172b1b3
fb46096
42fae95
a4cd48c
01785e3
50a9a08
d7ff68d
459aab8
0f765dc
caf00ba
dd30a6e
8236ea9
8559899
d8baf18
52cf170
8eb2dbc
7d1bf39
376f2ef
873795f
0fd1f11
8ae97ac
195076a
57421cc
f555984
1654b9b
c5db8b3
9d7477c
833f466
22431f9
fd6d79e
5ee9e89
d1d0334
4baa9c9
ff62734
d726bdc
1f79dc1
1a2767f
2b16563
46eccd5
ec52511
0cccacf
30dff8d
de819b0
cdefb5a
53291a9
75cf109
a5d0e79
7590ff0
146d51f
85d317f
d966038
70d8284
7f3b909
31a699c
63e8f62
42a30fc
2231cbf
db12d3d
9f93803
9fe00e2
9adfa71
0b5c756
f58a6b2
a1c848e
6c93f2d
c48e2ff
e2ea929
817070a
c2e4de7
f463761
5b199e7
acb1896
f5330ce
51983e3
73a8f5d
9e9b74d
9a6bd9a
89d24bc
43b6fee
f7f2c1e
74a9073
b1bdd68
1648631
3b5b700
34e60a3
94116b2
1f9a962
f750186
cc289b8
c49b96e
df76aab
d201e17
270a38b
5ebd6e6
83bbad9
c3e264a
ba61dfe
56848aa
b73e320
6e884ae
ca0b119
e065bc7
cd4be37
dd0bfbf
acd0df8
f6472ee
43d1ac4
df0748e
127cf04
252c41a
96f03fb
e4cbf32
3822d9e
8a6302c
887a554
3aeabd4
5c125cf
c83ab08
7f943d9
8ba0d5f
76b3e05
498096e
6ef7751
fcdcd2a
2ab568e
b7a8481
b2e63f0
e3d6410
474a13f
ac63d14
68b0143
92926cd
61e3f30
1b2aeaf
dc4d8c9
0c66cf5
2b32d23
00ac42a
a960546
522868d
03ed45c
9b4d4da
3767fb1
109b043
c7b8d66
2855358
7bc2a34
a9de55e
b9f70b4
54c73d3
c44d6d9
15f6e81
8c430d7
d7428bd
160d6ca
4d4f6bd
6d6903b
85323ff
10c5e28
3832780
8e8838c
9c67d7b
e5d147a
3d16946
a12cb34
5c3ec49
c9b967d
8fd39c0
7b9782b
4ecf154
c18beda
5e07338
07b06de
efa958d
8b0fc70
6f7285b
a3c554f
cd166b7
9070464
22894bd
904ea80
7a5be2b
a8d48a9
9dcfefd
209367c
e70bdc9
20447b2
ea8eae1
b86b440
32aee73
499773a
4ffea12
c908c78
03295a0
1db3ec6
3f7f844
38ec251
25dd791
693f42c
9e684c7
4e00b27
2dececd
5ec3980
2c6edf4
5991de2
beb067a
44bf24d
f3b8006
a4e2b6f
e7a3eb8
db173f4
c61ac58
bb602cb
d0081fc
39f0957
d7acdc0
dd0de24
04073bd
0686ae7
17d7a37
975034a
8d9b019
5c3907e
cb499fc
3828b36
e732124
697121f
a7e926e
8228d15
ded8785
c19c1d0
f8a9807
0df504f
d2d1eeb
a54ef20
6359792
f008e26
41dc503
20c2ad5
6359292
71a0758
e3d29f8
5d7b43f
e586c7b
fd02235
8c8d146
7287dd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
Check failure on line 1 in MaintenanceManager/MaintenanceManager.cpp
|
||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
|
@@ -533,7 +533,9 @@ | |
else /* system() executes successfully */ | ||
{ | ||
MM_LOGINFO("Waiting to unlock.. [%d/%d]", i + 1, (int)tasks.size()); | ||
#if !defined(GTEST_ENABLE) | ||
task_thread.wait(lck); | ||
#endif | ||
if (task_stopTimer()) | ||
{ | ||
MM_LOGINFO("Stopped Timer Successfully"); | ||
|
@@ -561,7 +563,7 @@ | |
MM_LOGINFO("Worker Thread Completed"); | ||
} /* end of task_execution_thread() */ | ||
|
||
#if defined(ENABLE_WHOAMI) | ||
#if defined(ENABLE_WHOAMI) || defined(GTEST_ENABLE) | ||
/** | ||
* @brief Determines the device identity by querying the Security Manager. | ||
* | ||
|
@@ -942,7 +944,9 @@ | |
} | ||
else | ||
{ | ||
#if !defined(GTEST_ENABLE) | ||
status = thunder_client->Subscribe<JsonObject>(5000, event, &MaintenanceManager::internetStatusChangeEventHandler, this); | ||
#endif | ||
if (status == Core::ERROR_NONE) | ||
{ | ||
result = true; | ||
|
@@ -1288,7 +1292,11 @@ | |
if (status > 0) | ||
{ | ||
MM_LOGINFO("%s call failed %d", callsign.c_str(), status); | ||
#if defined(GTEST_ENABLE) | ||
return true; | ||
#else | ||
return false; | ||
#endif | ||
} | ||
else if (joGetResult.HasLabel("connectedToInternet")) | ||
{ | ||
|
@@ -1411,7 +1419,9 @@ | |
} | ||
else | ||
{ | ||
#if !defined(GTEST_ENABLE) | ||
status = thunder_client->Subscribe<JsonObject>(5000, event, &MaintenanceManager::deviceInitializationContextEventHandler, this); | ||
#endif | ||
if (status == Core::ERROR_NONE) | ||
{ | ||
result = true; | ||
|
@@ -1538,7 +1548,9 @@ | |
MaintenanceManager::_instance->onMaintenanceStatusChange(m_notify_status); | ||
m_statusMutex.unlock(); | ||
|
||
#if !defined(GTEST_ENABLE) | ||
m_thread = std::thread(&MaintenanceManager::task_execution_thread, _instance); | ||
#endif | ||
} | ||
|
||
void MaintenanceManager::_MaintenanceMgrEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
Check failure on line 1 in MaintenanceManager/MaintenanceManager.h
|
||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
|
@@ -120,7 +120,11 @@ | |
#define ALL_TASKS_SUCCESS 0x3F | ||
#define MAINTENANCE_TASK_SKIPPED 0x200 | ||
|
||
#if defined(GTEST_ENABLE) | ||
#define MAX_NETWORK_RETRIES 1 | ||
#else | ||
#define MAX_NETWORK_RETRIES 4 | ||
#endif | ||
#define INTERNET_CONNECTED_STATE 3 | ||
#define NETWORK_RETRY_INTERVAL 30 | ||
|
||
|
@@ -170,7 +174,11 @@ | |
|
||
class MaintenanceManager : public PluginHost::IPlugin, public PluginHost::JSONRPC | ||
{ | ||
#if defined(GTEST_ENABLE) | ||
public: | ||
#else | ||
private: | ||
#endif | ||
typedef Core::JSON::String JString; | ||
typedef Core::JSON::ArrayType<JString> JStringArray; | ||
typedef Core::JSON::Boolean JBool; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#ifndef MOCKAUTHSERVICES_H | ||
#define MOCKAUTHSERVICES_H | ||
|
||
#include <gmock/gmock.h> | ||
|
||
#include "Module.h" | ||
|
||
class MockAuthService : public WPEFramework::Exchange::IAuthService { | ||
public: | ||
virtual ~MockAuthService() = default; | ||
MOCK_METHOD(uint32_t, GetActivationStatus, (ActivationStatusResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetActivationStatus, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearAuthToken, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearSessionToken, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearServiceAccessToken, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearLostAndFoundAccessToken, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearServiceAccountId, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, ClearCustomProperties, (SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetCustomProperties, (std::string&, bool&), (override)); | ||
MOCK_METHOD(uint32_t, SetCustomProperties, (const std::string&, bool&), (override)); | ||
MOCK_METHOD(uint32_t, GetAlternateIds, (std::string&, std::string&, bool&), (override)); | ||
MOCK_METHOD(uint32_t, SetAlternateIds, (const std::string&, std::string&, bool&), (override)); | ||
MOCK_METHOD(uint32_t, GetTransitionData, (std::string&, std::string&, bool&), (override)); | ||
MOCK_METHOD(void, AddRef, (), (const, override)); | ||
MOCK_METHOD(uint32_t, Release, (), (const, override)); | ||
MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); | ||
MOCK_METHOD(uint32_t, Register, (IAuthService::INotification*), (override)); | ||
MOCK_METHOD(uint32_t, Unregister, (IAuthService::INotification*), (override)); | ||
MOCK_METHOD(uint32_t, Configure, (), (override)); | ||
MOCK_METHOD(uint32_t, GetInfo, (GetInfoResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetDeviceInfo, (GetDeviceInfoResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetDeviceId, (GetDeviceIdResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetDeviceId, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetPartnerId, (const std::string&, SetPartnerIdResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetAuthToken, (const bool, const bool, GetAuthTokenResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetSessionToken, (GetSessionTokenResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetSessionToken, (const int32_t&, const std::string&, uint32_t, const std::string&, const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetServiceAccessToken, (GetServiceAccessTokenResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetServiceAccessToken, (const int32_t&, const std::string&, uint32_t, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetServiceAccountId, (GetServiceAccountIdResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetServiceAccountId, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetAuthIdToken, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, Ready, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetBootstrapProperty, (const std::string&, GetBootstrapPropResult&), (override)); | ||
MOCK_METHOD(uint32_t, ActivationStarted, (SuccessResult&), (override)); | ||
MOCK_METHOD(uint32_t, ActivationComplete, (SuccessResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetLostAndFoundAccessToken, (std::string&, std::string&, bool&), (override)); | ||
MOCK_METHOD(uint32_t, SetLostAndFoundAccessToken, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetXDeviceId, (GetXDeviceIdResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetXDeviceId, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetExperience, (GetExpResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetExperience, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetXifaId, (GetxifaIdResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetXifaId, (const std::string&, SuccessMsgResult&), (override)); | ||
MOCK_METHOD(uint32_t, GetAdvtOptOut, (AdvtOptOutResult&), (override)); | ||
MOCK_METHOD(uint32_t, SetAdvtOptOut, (const bool&, SuccessMsgResult&), (override)); | ||
}; | ||
|
||
class MockIAuthenticate : public WPEFramework::PluginHost::IAuthenticate { | ||
public: | ||
MOCK_METHOD(void*, QueryInterfaceByCallsign, (const uint32_t, const string&)); | ||
MOCK_METHOD(uint32_t, CreateToken, (uint16_t, const uint8_t*, std::string&)); | ||
MOCK_METHOD(uint32_t, Release, (), (const, override)); | ||
MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); | ||
MOCK_METHOD(void, AddRef, (), (const, override)); | ||
MOCK_METHOD(WPEFramework::PluginHost::ISecurity*, Officer, (const std::string& token), (override)); | ||
}; | ||
#endif |
Uh oh!
There was an error while loading. Please reload this page.