Skip to content
Snippets Groups Projects
Verified Commit 9f9f6a44 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: upgrade tests

parent 7d39e18d
Branches
Tags
2 merge requests!20BUG: Broken FIND {id},!11DRAFT: file system cleanup
Pipeline #42470 failed
This commit is part of merge request !20. Comments created here will be created in the context of that merge request.
...@@ -88,4 +88,5 @@ pipeline-test: ...@@ -88,4 +88,5 @@ pipeline-test:
sleep 10 sleep 10
make install make install
./utils/make_db restore_db tests/example.dump.sql ./utils/make_db restore_db tests/example.dump.sql
make upgrade
./tests/test_utils.sh ./tests/test_utils.sh
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
Drop Procedure if exists db_5_0.insertUser;
Delimiter //
Create Procedure db_5_0.insertUser(in Name VARCHAR(255), in Password VARCHAR(255))
BEGIN
INSERT INTO entities (name, role, acl) VALUES (Name, 'USER', 0);
SET @LAST_UserID = LAST_INSERT_ID();
INSERT INTO passwords VALUES (@LAST_UserID, Password);
Select @LAST_UserID as UserID;
END;
//
delimiter ;
...@@ -563,31 +563,6 @@ INSERT INTO `passwd` VALUES ('guest','3fe82ca86837d4f9ff765d2d4265ded96843314936 ...@@ -563,31 +563,6 @@ INSERT INTO `passwd` VALUES ('guest','3fe82ca86837d4f9ff765d2d4265ded96843314936
/*!40000 ALTER TABLE `passwd` ENABLE KEYS */; /*!40000 ALTER TABLE `passwd` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
   
--
-- Table structure for table `passwords`
--
DROP TABLE IF EXISTS `passwords`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `passwords` (
`entity_id` int(10) unsigned NOT NULL COMMENT 'User ID.',
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Password.',
PRIMARY KEY (`entity_id`),
CONSTRAINT `use_entity_id_entity` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `passwords`
--
LOCK TABLES `passwords` WRITE;
/*!40000 ALTER TABLE `passwords` DISABLE KEYS */;
INSERT INTO `passwords` VALUES (98,'37d7bd8a833261b4e4653644ee0a065f522b92b3738ca9ae2cb43a83844bf352c4a59c386a44965997a508c61988c9484c093775027425091d6d3d435c3c0e0c'),(99,'37d7bd8a833261b4e4653644ee0a065f522b92b3738ca9ae2cb43a83844bf352c4a59c386a44965997a508c61988c9484c093775027425091d6d3d435c3c0e0c');
/*!40000 ALTER TABLE `passwords` ENABLE KEYS */;
UNLOCK TABLES;
-- --
-- Table structure for table `permissions` -- Table structure for table `permissions`
-- --
...@@ -2783,34 +2758,6 @@ BEGIN ...@@ -2783,34 +2758,6 @@ BEGIN
   
INSERT IGNORE INTO units_lin_con (signature_from, signature_to, a, b_dividend, b_divisor, c) VALUES (signature_from, signature_to, a, b_dividend, b_divisor, c); INSERT IGNORE INTO units_lin_con (signature_from, signature_to, a, b_dividend, b_divisor, c) VALUES (signature_from, signature_to, a, b_dividend, b_divisor, c);
   
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `insertUser` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`caosdb`@`%` PROCEDURE `insertUser`(in Name VARCHAR(255), in Password VARCHAR(255))
BEGIN
INSERT INTO entities (name, role, acl) VALUES (Name, 'USER', 0);
SET @LAST_UserID = LAST_INSERT_ID();
INSERT INTO passwords VALUES (@LAST_UserID, Password);
Select @LAST_UserID as UserID;
END ;; END ;;
DELIMITER ; DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET sql_mode = @saved_sql_mode */ ;
...@@ -3168,29 +3115,6 @@ BEGIN ...@@ -3168,29 +3115,6 @@ BEGIN
SELECT collection as collection_override, NULL as name_override, NULL as desc_override, NULL as type_override, entity_id, property_id from collection_type where domain_id=DomainID and entity_id=EntityID; SELECT collection as collection_override, NULL as name_override, NULL as desc_override, NULL as type_override, entity_id, property_id from collection_type where domain_id=DomainID and entity_id=EntityID;
   
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `setPassword` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`caosdb`@`%` PROCEDURE `setPassword`(in EntityID INT UNSIGNED, in NewPassword VARCHAR(255))
BEGIN
DELETE FROM passwords where entity_id=EntityID;
INSERT INTO passwords (entity_id, password) VALUES (EntityID, NewPassword);
END ;; END ;;
DELIMITER ; DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET sql_mode = @saved_sql_mode */ ;
......
...@@ -2572,13 +2572,6 @@ SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertLinCon' ...@@ -2572,13 +2572,6 @@ SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertLinCon'
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertLinCon','DEFINER',''); SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertLinCon','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertLinCon','CONTAINS SQL',''); SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertLinCon','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.insertUser
SELECT tap.has_procedure('_caosdb_schema_unit_tests','insertUser','');
SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','insertUser','NO','');
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','insertUser','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','insertUser','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.intersectTable -- PROCEDURES _caosdb_schema_unit_tests.intersectTable
SELECT tap.has_procedure('_caosdb_schema_unit_tests','intersectTable',''); SELECT tap.has_procedure('_caosdb_schema_unit_tests','intersectTable','');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment