Skip to content

Commit

Permalink
Run test container as user root (#1468)
Browse files Browse the repository at this point in the history
* run test container as user aoc

* run test container as root

* Remove unuseful thread
  • Loading branch information
vasireddy99 authored Oct 26, 2023
1 parent 53215a2 commit 622db0f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private GenericContainer<?> createAndStartCollector(String configFilePath, Strin
.withLogConsumer(new Slf4jLogConsumer(collectorLogger))
.waitingFor(Wait.forLogMessage(".*Everything is ready. Begin running and processing data.*", 1))
.withEnv(envVariables)
.withCreateContainerCmdModifier(cmd -> cmd.withUser("root"))
.withClasspathResourceMapping("/logs", "/logs", BindMode.READ_WRITE)
.withCommand("--config", "/etc/collector/config.yaml", "--feature-gates=+adot.receiver.filelog,+adot.exporter.awscloudwatchlogs,+adot.extension.file_storage");

Expand All @@ -96,7 +97,6 @@ private GenericContainer<?> createAndStartCollector(String configFilePath, Strin
void testSyslog() throws Exception {
String logStreamName = "rfcsyslog-logstream-" + uniqueID;
collector = createAndStartCollector("/configurations/config-rfcsyslog.yaml", logStreamName);

List<InputStream> inputStreams = new ArrayList<>();
InputStream inputStream = getClass().getResourceAsStream("/logs/RFC5424.log");
inputStreams.add(inputStream);
Expand All @@ -110,7 +110,6 @@ void testSyslog() throws Exception {
void testLog4j() throws Exception {
String logStreamName = "log4j-logstream-" + uniqueID;
collector = createAndStartCollector("/configurations/config-log4j.yaml", logStreamName);

List<InputStream> inputStreams = new ArrayList<>();
InputStream inputStream = getClass().getResourceAsStream("/logs/log4j.log");
inputStreams.add(inputStream);
Expand All @@ -123,7 +122,6 @@ void testLog4j() throws Exception {
void testJson() throws Exception {
String logStreamName = "json-logstream-" + uniqueID;
collector = createAndStartCollector("/configurations/config-json.yaml", logStreamName);

List<InputStream> inputStreams = new ArrayList<>();
InputStream inputStream = getClass().getResourceAsStream("/logs/testingJSON.log");
inputStreams.add(inputStream);
Expand Down

0 comments on commit 622db0f

Please sign in to comment.