Feature target metadata filter (#767)

* implemented RSQL query filter for target metadata

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* refactored rsql fields providers code for targets, distribution sets and software modules for consistency, fixed predicate grouping for map fields in rsql utility

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* extended tests for target management rsql queries with target metadata

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* extended target management test for RSQL not equal case of target metadata, added a suggestion of comparator operators when map key ends with = or ! symbol in Target Filter View

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* Fixed peer review findings

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* small test fixes: seconds are respected while scheduling the maintenance window, redundant ds-target assignment statement removed

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>
This commit is contained in:
Bondar Bogdan
2018-11-28 14:09:52 +01:00
committed by Dominic Schabel
parent a460f61e13
commit b2dfd4a99e
16 changed files with 272 additions and 153 deletions

View File

@@ -54,6 +54,7 @@ import org.eclipse.hawkbit.repository.model.MetaData;
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetMetadata;
import org.eclipse.hawkbit.repository.model.TargetWithActionType;
import org.eclipse.hawkbit.repository.test.TestConfiguration;
import org.eclipse.hawkbit.repository.test.matcher.EventVerifier;
@@ -297,6 +298,14 @@ public abstract class AbstractIntegrationTest {
return distributionSetManagement.createMetaData(dsId, md);
}
protected TargetMetadata createTargetMetadata(final String controllerId, final MetaData md) {
return createTargetMetadata(controllerId, Collections.singletonList(md)).get(0);
}
protected List<TargetMetadata> createTargetMetadata(final String controllerId, final List<MetaData> md) {
return targetManagement.createMetaData(controllerId, md);
}
protected Long getOsModule(final DistributionSet ds) {
return ds.findFirstModuleByType(osType).get().getId();
}
@@ -395,8 +404,8 @@ public abstract class AbstractIntegrationTest {
protected static String getTestSchedule(final int minutesToAdd) {
ZonedDateTime currentTime = ZonedDateTime.now();
currentTime = currentTime.plusMinutes(minutesToAdd);
return String.format("0 %d %d %d %d ? %d", currentTime.getMinute(), currentTime.getHour(),
currentTime.getDayOfMonth(), currentTime.getMonthValue(), currentTime.getYear());
return String.format("%d %d %d %d %d ? %d", currentTime.getSecond(), currentTime.getMinute(),
currentTime.getHour(), currentTime.getDayOfMonth(), currentTime.getMonthValue(), currentTime.getYear());
}
protected static String getTestDuration(final int duration) {