[metron-bro-plugin-kafka] branch master updated: METRON-1990 Bro plugin docker should exit nonzero if it encounters issues (JonZeolla) closes apache/metron-bro-plugin-kafka#28

2019-02-25 Thread jonzeolla
This is an automated email from the ASF dual-hosted git repository.

jonzeolla pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/metron-bro-plugin-kafka.git


The following commit(s) were added to refs/heads/master by this push:
 new 2655f71  METRON-1990 Bro plugin docker should exit nonzero if it 
encounters issues (JonZeolla) closes apache/metron-bro-plugin-kafka#28
2655f71 is described below

commit 2655f71694bde2e12e61fa9522a41a452161d845
Author: JonZeolla 
AuthorDate: Mon Feb 25 08:14:38 2019 -0500

METRON-1990 Bro plugin docker should exit nonzero if it encounters issues 
(JonZeolla) closes apache/metron-bro-plugin-kafka#28
---
 docker/in_docker_scripts/process_data_file.sh  |  5 -
 docker/run_end_to_end.sh   |  3 +++
 docker/scripts/docker_run_bro_container.sh | 10 +-
 docker/scripts/docker_run_consume_bro_kafka.sh |  3 +++
 docker/scripts/docker_run_create_bro_topic_in_kafka.sh |  3 +++
 docker/scripts/docker_run_get_offset_bro_kafka.sh  |  3 +++
 6 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/docker/in_docker_scripts/process_data_file.sh 
b/docker/in_docker_scripts/process_data_file.sh
index 021c5fd..81819a2 100755
--- a/docker/in_docker_scripts/process_data_file.sh
+++ b/docker/in_docker_scripts/process_data_file.sh
@@ -74,5 +74,8 @@ if [ ! -d /root/data ]; then
   exit 1
 fi
 cd /root/test_output/"${OUTPUT_DIRECTORY_NAME}" || exit 1
-find /root/data -type f -name "${PCAP_FILE_NAME}" -exec echo "processing" '{}' 
\; -exec bro -r '{}' /usr/local/bro/share/bro/site/local.bro -C \;
+find /root/data -type f -name "${PCAP_FILE_NAME}" -print0 | xargs -0 bro -r {} 
/usr/local/bro/share/bro/site/local.bro -C
+rc=$?; if [[ ${rc} != 0 ]]; then
+  exit ${rc}
+fi
 echo "done with ${PCAP_FILE_NAME}"
diff --git a/docker/run_end_to_end.sh b/docker/run_end_to_end.sh
index 950dc60..6baf679 100755
--- a/docker/run_end_to_end.sh
+++ b/docker/run_end_to_end.sh
@@ -131,6 +131,9 @@ fi
 # Download the pcaps
 bash "${SCRIPT_DIR}"/download_sample_pcaps.sh --data-path="${DATA_PATH}"
 
+# By not catching $? here we are accepting that a failed pcap download will not
+# exit the script
+
 mkdir "${TEST_OUTPUT_PATH}" || exit 1
 
 # Run the bro container and optionally the passed script _IN_ the container
diff --git a/docker/scripts/docker_run_bro_container.sh 
b/docker/scripts/docker_run_bro_container.sh
index 1e31b25..aba5d5f 100755
--- a/docker/scripts/docker_run_bro_container.sh
+++ b/docker/scripts/docker_run_bro_container.sh
@@ -137,13 +137,13 @@ echo "==="
 declare -a DOCKER_CMD_BASE
 DOCKER_CMD="bash"
 DOCKER_CMD_BASE[0]="docker run -d -t --name ${CONTAINER_NAME} --network 
${NETWORK_NAME} "
-DOCKER_CMD_BASE[2]="-v \"${OUR_SCRIPTS_PATH}:/root/built_in_scripts\" "
-DOCKER_CMD_BASE[3]="-v \"${BRO_PLUGIN_PATH}:/root/code\" "
-DOCKER_CMD_BASE[4]="-v \"${TEST_OUTPUT_PATH}:/root/test_output\" "
-OFFSET=5
+DOCKER_CMD_BASE[1]="-v \"${OUR_SCRIPTS_PATH}:/root/built_in_scripts\" "
+DOCKER_CMD_BASE[2]="-v \"${BRO_PLUGIN_PATH}:/root/code\" "
+DOCKER_CMD_BASE[3]="-v \"${TEST_OUTPUT_PATH}:/root/test_output\" "
+OFFSET=4
 if [[ -n "$SCRIPTS_PATH" ]]; then
   DOCKER_CMD_BASE[$OFFSET]="-v \"${SCRIPTS_PATH}:/root/scripts\" "
-  OFFSET=6
+  OFFSET=5
 fi
 
 if [[ -n "$DATA_PATH" ]]; then
diff --git a/docker/scripts/docker_run_consume_bro_kafka.sh 
b/docker/scripts/docker_run_consume_bro_kafka.sh
index eea740a..5a7bbcf 100755
--- a/docker/scripts/docker_run_consume_bro_kafka.sh
+++ b/docker/scripts/docker_run_consume_bro_kafka.sh
@@ -83,4 +83,7 @@ done
 
 docker run --rm --network "${NETWORK_NAME}" ches/kafka \
   kafka-console-consumer.sh --topic bro --offset "${OFFSET}" --partition 0 
--bootstrap-server kafka:9092 --timeout-ms 1000
+rc=$?; if [[ ${rc} != 0 ]]; then
+  exit ${rc}
+fi
 
diff --git a/docker/scripts/docker_run_create_bro_topic_in_kafka.sh 
b/docker/scripts/docker_run_create_bro_topic_in_kafka.sh
index cb00e2c..f4c84ab 100755
--- a/docker/scripts/docker_run_create_bro_topic_in_kafka.sh
+++ b/docker/scripts/docker_run_create_bro_topic_in_kafka.sh
@@ -71,4 +71,7 @@ echo "==="
 
 docker run --rm --network "${NETWORK_NAME}" ches/kafka \
   kafka-topics.sh --create --topic bro --replication-factor 1 --partitions 1 
--zookeeper zookeeper:2181
+rc=$?; if [[ ${rc} != 0 ]]; then
+  exit ${rc}
+fi
 
diff --git a/docker/scripts/docker_run_get_offset_bro_kafka.sh 
b/docker/scripts/docker_run_get_offset_bro_kafka.sh
index d3b6621..eafd08f 100755
--- a/docker/scripts/docker_run_get_offset_bro_kafka.sh
+++ b/docker/scripts/docker_run_get_offset_bro_kafka.sh
@@ -72,4 +72,7 @@ done
 
 docker run --rm --network "${NETWORK_NAME}" ches/kafka \
   kafka-run-class.sh kafka.tools.GetOffsetShell --topic bro --broker-list 
kafka:9092
+rc=$?; if [[ ${rc} != 0 ]]; then
+  exit ${rc}
+fi
 



[metron] branch master updated: METRON-1944 Unable to Delete a Comment in Alerts UI (ruffle1986 via sardell) closes apache/metron#1307

2019-02-25 Thread sardell
This is an automated email from the ASF dual-hosted git repository.

sardell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/metron.git


The following commit(s) were added to refs/heads/master by this push:
 new 792e796  METRON-1944 Unable to Delete a Comment in Alerts UI 
(ruffle1986 via sardell) closes apache/metron#1307
792e796 is described below

commit 792e7962f32b8154cd501edb65fa3fb5819758dc
Author: ruffle1986 
AuthorDate: Mon Feb 25 10:40:55 2019 +0100

METRON-1944 Unable to Delete a Comment in Alerts UI (ruffle1986 via 
sardell) closes apache/metron#1307
---
 .../alert-details/alert-details.component.html |  24 -
 .../alert-details/alert-details.component.spec.ts  | 108 +
 .../alert-details/alert-details.component.ts   |  12 +--
 3 files changed, 133 insertions(+), 11 deletions(-)

diff --git 
a/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.html
 
b/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.html
index f8fdc1d..abc01ca 100644
--- 
a/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.html
+++ 
b/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.html
@@ -17,12 +17,22 @@
 
 
 
-
+
 
 
 
 
-
+
 
 
 
@@ -86,8 +96,14 @@
 ADD 
COMMENT
 
 
-
-
+
+
+
  {{ 
alertCommentWrapper.alertComment.comment }} 
  - 
{{ alertCommentWrapper.alertComment.username }} - 
{{alertCommentWrapper.displayTime}}
 
diff --git 
a/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.spec.ts
 
b/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.spec.ts
new file mode 100644
index 000..b875613
--- /dev/null
+++ 
b/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.spec.ts
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { async, ComponentFixture, TestBed, fakeAsync, tick } from 
'@angular/core/testing';
+
+import { AlertDetailsComponent, AlertCommentWrapper } from 
'./alert-details.component';
+import { SharedModule } from 'app/shared/shared.module';
+import { AlertDetailsKeysPipe } from './alert-details-keys.pipe';
+import { AuthenticationService } from 'app/service/authentication.service';
+import { AlertsService } from 'app/service/alerts.service';
+import { UpdateService } from 'app/service/update.service';
+import { RouterTestingModule } from '@angular/router/testing';
+import { SearchService } from 'app/service/search.service';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { AppConfigService } from 'app/service/app-config.service';
+import { GlobalConfigService } from 'app/service/global-config.service';
+import { DataSource } from 'app/service/data-source';
+import { ElasticSearchLocalstorageImpl } from 
'app/service/elasticsearch-localstorage-impl';
+import { DialogService } from 'app/service/dialog.service';
+import { By } from '@angular/platform-browser';
+import { AlertComment } from './alert-comment';
+import { Subject } from 'rxjs';
+import { ConfirmationType } from 'app/model/confirmation-type';
+
+describe('AlertDetailsComponent', () => {
+  let component: AlertDetailsComponent;
+  let fixture: ComponentFixture;
+
+  beforeEach(async(() => {
+TestBed.configureTestingModule({
+  imports: [
+SharedModule,
+HttpClientTestingModule,
+RouterTestingModule.withRoutes([])
+  ],
+  declarations: [ AlertDetailsComponent,