asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murtadha Hubail (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: ASTERIXDB-1114: Add test case to validate issue fix
Date Sun, 27 Sep 2015 23:06:52 GMT
Murtadha Hubail has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/413

Change subject: ASTERIXDB-1114: Add test case to validate issue fix
......................................................................

ASTERIXDB-1114: Add test case to validate issue fix

Change-Id: Ic5a7f069ab3cfec3ca12236529a0ae8f8ce52c00
---
M asterix-installer/src/test/java/org/apache/asterix/installer/transaction/RecoveryIT.java
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.1.script.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.2.ddl.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.3.script.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.4.ddl.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.5.update.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.6.script.aql
A asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.7.script.aql
A asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/create_and_start.sh
A asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_delete.sh
A asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_start.sh
A asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/verify_deletion.sh
M asterix-installer/src/test/resources/transactionts/testsuite.xml
13 files changed, 123 insertions(+), 0 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/13/413/1

diff --git a/asterix-installer/src/test/java/org/apache/asterix/installer/transaction/RecoveryIT.java
b/asterix-installer/src/test/java/org/apache/asterix/installer/transaction/RecoveryIT.java
index c70b504..c2d846e 100644
--- a/asterix-installer/src/test/java/org/apache/asterix/installer/transaction/RecoveryIT.java
+++ b/asterix-installer/src/test/java/org/apache/asterix/installer/transaction/RecoveryIT.java
@@ -90,6 +90,9 @@
         FileUtils.deleteDirectory(dataCopyDir);
         TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" +
File.separator
                 + "stop_and_delete.sh");
+        //verify that no hanging CC/NCs processes are still active by killing them.
+        TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" +
File.separator
+                + "kill_cc_and_nc.sh");
         TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" +
File.separator
                 + "shutdown.sh");
     }
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.1.script.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.1.script.aql
new file mode 100644
index 0000000..323b1cf
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.1.script.aql
@@ -0,0 +1 @@
+create_and_start.sh
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.2.ddl.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.2.ddl.aql
new file mode 100644
index 0000000..2aa3ee3
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.2.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : secondary_index_on_closed_dataset..aql
+ * Description     : Check that a secondary index is created and modified correctely on a
closed dataset.   
+ * Expected Result : Success
+ * Date            : Sep 27 2015
+ */
+
+/********* 1. Create Types  ***********/
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type FacebookUserType as closed {
+    id: int,
+    name: string
+}
+
+/********* 2. Create Datasets  ***********/
+drop dataset FacebookUsers if exists;
+
+create dataset FacebookUsers(FacebookUserType)
+primary key id;
+
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.3.script.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.3.script.aql
new file mode 100644
index 0000000..37ef6c0
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.3.script.aql
@@ -0,0 +1 @@
+stop_and_start.sh
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.4.ddl.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.4.ddl.aql
new file mode 100644
index 0000000..f575c22
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.4.ddl.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : secondary_index_on_closed_dataset..aql
+ * Description     : Check that a secondary index is created and modified correctely on a
closed dataset.   
+ * Expected Result : Success
+ * Date            : Sep 27 2015
+ */
+
+/********* 1. Create Secondary Index  ***********/
+use dataverse TinySocial;
+
+use dataverse TinySocial;
+create index fbName on FacebookUsers(name);
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.5.update.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.5.update.aql
new file mode 100644
index 0000000..1c6a8fc
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.5.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : secondary_index_on_closed_dataset..aql
+ * Description     : Check that a secondary index is created and modified correctely on a
closed dataset.   
+ * Expected Result : Success
+ * Date            : Sep 27 2015
+ */
+
+/********* 1. Insert record  ***********/
+use dataverse TinySocial;
+
+insert into dataset FacebookUsers{"id":1,"name":"foo"};
+
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.6.script.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.6.script.aql
new file mode 100644
index 0000000..f75dfc9
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.6.script.aql
@@ -0,0 +1 @@
+stop_and_delete.sh
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.7.script.aql
b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.7.script.aql
new file mode 100644
index 0000000..f6fd894
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/queries/dataset_lifecycle/secondary_index_on_closed_dataset/secondary_index_on_closed_dataset.7.script.aql
@@ -0,0 +1 @@
+verify_deletion.sh
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/create_and_start.sh
b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/create_and_start.sh
new file mode 100755
index 0000000..945f01d
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/create_and_start.sh
@@ -0,0 +1 @@
+$MANAGIX_HOME/bin/managix create -n nc1 -c $MANAGIX_HOME/clusters/local/local.xml;
diff --git a/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_delete.sh
b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_delete.sh
new file mode 100755
index 0000000..d7deea3
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_delete.sh
@@ -0,0 +1,3 @@
+$MANAGIX_HOME/bin/managix stop -n nc1;
+$MANAGIX_HOME/bin/managix delete -n nc1;
+
diff --git a/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_start.sh
b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_start.sh
new file mode 100755
index 0000000..7855938
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/stop_and_start.sh
@@ -0,0 +1,3 @@
+$MANAGIX_HOME/bin/managix stop -n nc1;
+$MANAGIX_HOME/bin/managix start -n nc1;
+
diff --git a/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/verify_deletion.sh
b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/verify_deletion.sh
new file mode 100755
index 0000000..9c60d8b
--- /dev/null
+++ b/asterix-installer/src/test/resources/transactionts/scripts/dataset_lifecycle/secondary_index_on_closed_dataset/verify_deletion.sh
@@ -0,0 +1 @@
+jps | awk '{if ($2 == "NCDriver") print "ERROR: NC was not shutdown successfully.";}'
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/testsuite.xml b/asterix-installer/src/test/resources/transactionts/testsuite.xml
index cf95132..ca2a9bd 100644
--- a/asterix-installer/src/test/resources/transactionts/testsuite.xml
+++ b/asterix-installer/src/test/resources/transactionts/testsuite.xml
@@ -186,4 +186,11 @@
  
   </test-group>
 
+  <test-group name="dataset_lifecycle">
+      <test-case FilePath="dataset_lifecycle">
+      <compilation-unit name="secondary_index_on_closed_dataset">
+        <output-dir compare="Text">secondary_index_on_closed_dataset</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
 </test-suite>

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/413
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5a7f069ab3cfec3ca12236529a0ae8f8ce52c00
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Murtadha Hubail <hubailmor@gmail.com>

Mime
View raw message