4
4
#include " Context.h"
5
5
#include " Utils.h"
6
6
7
+ #include " version.h"
8
+
7
9
namespace {
8
10
9
11
class ProtocolJSON : public sua ::MqttMessagingProtocolJSON {
@@ -84,6 +86,8 @@ namespace {
84
86
85
87
TEST_F (TestMessagingProtocolJSON, createMessage_systemVersionWithoutActivityId)
86
88
{
89
+ SUA_BUILD_NUMBER = " 42" ;
90
+
87
91
ctx.desiredState .activityId = " " ;
88
92
const std::string result = ProtocolJSON ().createMessage (ctx, " systemVersion" );
89
93
@@ -94,15 +98,25 @@ namespace {
94
98
"payload": {
95
99
"softwareNodes": [
96
100
{
97
- "id": "os-image",
101
+ "id": "self-update-agent",
102
+ "version": "build-42,
103
+ "name": "OTA NG Self Update Agent",
104
+ "type": "APPLICATION"
105
+ },
106
+ {
107
+ "id": "self-update:leda-deviceimage",
98
108
"version": "1.0",
99
- "name": "System Image",
100
- "type": "IMAGE",
101
- "parameters": []
109
+ "name": "Official Leda device image",
110
+ "type": "IMAGE"
102
111
}
103
112
],
104
113
"hardwareNodes": [],
105
- "associations": []
114
+ "associations": [
115
+ {
116
+ "sourceId": "self-update-agent",
117
+ "targetId": "self-update:leda-deviceimage"
118
+ }
119
+ ]
106
120
}
107
121
}
108
122
)" ;
@@ -113,6 +127,8 @@ namespace {
113
127
114
128
TEST_F (TestMessagingProtocolJSON, createMessage_systemVersionWithActivityId)
115
129
{
130
+ SUA_BUILD_NUMBER = " 42" ;
131
+
116
132
const std::string result = ProtocolJSON ().createMessage (ctx, " systemVersion" );
117
133
118
134
// clang-format off
@@ -123,15 +139,25 @@ namespace {
123
139
"payload": {
124
140
"softwareNodes": [
125
141
{
126
- "id": "os-image",
142
+ "id": "self-update-agent",
143
+ "version": "build-42,
144
+ "name": "OTA NG Self Update Agent",
145
+ "type": "APPLICATION"
146
+ },
147
+ {
148
+ "id": "self-update:leda-deviceimage",
127
149
"version": "1.0",
128
- "name": "System Image",
129
- "type": "IMAGE",
130
- "parameters": []
150
+ "name": "Official Leda device image",
151
+ "type": "IMAGE"
131
152
}
132
153
],
133
154
"hardwareNodes": [],
134
- "associations": []
155
+ "associations": [
156
+ {
157
+ "sourceId": "self-update-agent",
158
+ "targetId": "self-update:leda-deviceimage"
159
+ }
160
+ ]
135
161
}
136
162
}
137
163
)" ;
0 commit comments