forked from GOCDB/gocdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests with new minimal sample dataset
Add RoleServiceTest2 to testsuite. Simplistic creation of minimal user objects for testing failed due to incoming requirement for UserIdentifiers.
- Loading branch information
Ian Neilson
committed
Jun 13, 2022
1 parent
47e261f
commit 2a753f1
Showing
28 changed files
with
1,265 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,38 +3,6 @@ | |
require_once __DIR__."/../bootstrap.php"; | ||
require_once __DIR__."/AddUtils.php"; | ||
|
||
/** | ||
* AddNGIs.php: Loads a list of NGIs from an XML file and inserts them into | ||
* the doctrine prototype. | ||
* XML format is the output from get_roc_list PI query, e.g: | ||
<EGEE_USER USER_ID=" " PRIMARY_KEY="63777G0"> | ||
<FORENAME>Patricia</FORENAME> | ||
<SURNAME>Gomes</SURNAME> | ||
<TITLE>Miss</TITLE> | ||
<DESCRIPTION></DESCRIPTION> | ||
<GOCDB_PORTAL_URL>https://testing.host.com/portal/index.php?Page_Type=View_Object&object_id=113158&grid_id=0</GOCDB_PORTAL_URL> | ||
<EMAIL>[email protected]</EMAIL> | ||
<TEL>+55(21)21417419</TEL> | ||
<WORKING_HOURS_START></WORKING_HOURS_START> | ||
<WORKING_HOURS_END></WORKING_HOURS_END> | ||
<CERTDN>/C=BR/O=ICPEDU/O=UFF BrGrid CA/O=CBPF/OU=LAFEX/CN=Patricia Gomes</CERTDN> | ||
<APPROVED></APPROVED> | ||
<ACTIVE></ACTIVE> | ||
<HOMESITE></HOMESITE> | ||
<USER_ROLE> | ||
<USER_ROLE>Regional First Line Support</USER_ROLE> | ||
<ON_ENTITY>ROC_LA</ON_ENTITY> | ||
<ENTITY_TYPE>group</ENTITY_TYPE> | ||
</USER_ROLE> | ||
<USER_ROLE> | ||
<USER_ROLE>Site Operations Deputy Manager</USER_ROLE> | ||
<ON_ENTITY>CBPF</ON_ENTITY> | ||
<ENTITY_TYPE>site</ENTITY_TYPE> | ||
</USER_ROLE> | ||
</EGEE_USER> | ||
*/ | ||
$usersRolesFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/UsersAndRoles.xml"; | ||
$usersRoles = simplexml_load_file($usersRolesFileName); | ||
|
||
|
@@ -125,4 +93,4 @@ | |
} | ||
} | ||
|
||
$entityManager->flush(); | ||
$entityManager->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
require_once __DIR__."/../bootstrap.php"; | ||
require_once __DIR__."/AddUtils.php"; | ||
|
||
/* Loads a list of service types from an XML file and inserts them into | ||
* the doctrine prototype. | ||
* XML format is the PROM GOCDB PI output for get_service_type | ||
*/ | ||
$stFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/ServiceGroups.xml"; | ||
$sts = simplexml_load_file($stFileName); | ||
|
||
foreach($sts as $st) { | ||
$instance = new ServiceGroup(); | ||
$name = ""; | ||
$desc = ""; | ||
$monitored = false; | ||
$email = "default@an_email.net"; | ||
$scope = "Local"; | ||
|
||
foreach ($st as $key => $value) { | ||
switch ($key) { | ||
case "NAME": | ||
$name = (string) $value; | ||
break; | ||
case "DESCRIPTION": | ||
$desc = (string) $value; | ||
break; | ||
case "MONITORED": | ||
if ( (string) $value == "Y") {$monitored = true;} | ||
break; | ||
case "CONTACT_EMAIL": | ||
$email = (string) $value; | ||
break; | ||
case "SCOPE": | ||
$scope = (string) $value; | ||
break; | ||
default: | ||
throw new LogicException("Unknown ServiceGroup key in input XML: ". $key); | ||
} | ||
} | ||
$instance->setName($name); | ||
$instance->setDescription($desc); | ||
$instance->setMonitored($monitored); | ||
$instance->setEmail($email); | ||
$instance->addScope(getScope($entityManager, $scope)); | ||
|
||
$entityManager->persist($instance); | ||
} | ||
|
||
$entityManager->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,4 @@ | |
} | ||
} | ||
} | ||
$entityManager->flush(); | ||
$entityManager->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lib/Doctrine/deploy/simpleSampleData/CertStatusChanges.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<result> | ||
<UNIX_TIME>1262304001</UNIX_TIME> | ||
<SITE>SITE_1</SITE> | ||
<OLD_STATUS>Uncertified</OLD_STATUS> | ||
<NEW_STATUS>Certified</NEW_STATUS> | ||
<CHANGED_BY>/CN=SOME CN</CHANGED_BY> | ||
<COMMENT>Record of a change of status</COMMENT> | ||
</result> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<site> | ||
<name>SITE_1</name> | ||
<cert_status>Certified</cert_status> | ||
<cert_date>01-JAN-10 00.00.01 AM</cert_date> | ||
</site> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<NGI> | ||
<NAME>NGI-1</NAME> | ||
<DESCRIPTION>A sample NGI</DESCRIPTION> | ||
<EMAIL>[email protected]</EMAIL> | ||
<SECURITY_EMAIL>[email protected]</SECURITY_EMAIL> | ||
</NGI> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Required tag seed data for scoping Sites and SEs --> | ||
<results> | ||
<tag grid_id="0"> | ||
<name key="primary">Local</name> | ||
</tag> | ||
<tag grid_id="0"> | ||
<name key="primary">EGI</name> | ||
</tag> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<SERVICE_ENDPOINT PRIMARY_KEY="44657G0"> | ||
<SITENAME>SITE-1</SITENAME> | ||
<HOSTNAME>service-1.site-1.org</HOSTNAME> | ||
<SERVICE_TYPE>CE</SERVICE_TYPE> | ||
<IN_PRODUCTION>Y</IN_PRODUCTION> | ||
<NODE_MONITORED>Y</NODE_MONITORED> | ||
<SCOPE>Local</SCOPE> | ||
<HOSTDN>/DC=org/DC=site-1/CN=service-1.site-1.org</HOSTDN> | ||
<HOST_IP>127.0.0.01</HOST_IP> | ||
<HOST_OS>SL5</HOST_OS> | ||
<HOST_ARCH>64 bit</HOST_ARCH> | ||
<DESCRIPTION>A service on Site 1</DESCRIPTION> | ||
|
||
<URL></URL> | ||
<!-- | ||
<PRIMARY_KEY>44657G0</PRIMARY_KEY> | ||
<GOCDB_PORTAL_URL>https://testing.host.com/portal/index.php?Page_Type=View_Object&object_id=26149&grid_id=0</GOCDB_PORTAL_URL> | ||
<BETA>N</BETA> | ||
<CORE></CORE> | ||
<COUNTRY_NAME>Switzerland</COUNTRY_NAME> | ||
<COUNTRY_CODE>CH</COUNTRY_CODE> | ||
<ROC_NAME>NGI_CH</ROC_NAME> --> | ||
</SERVICE_ENDPOINT> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<SERVICE_GROUP> | ||
<NAME>Group1_Services</NAME> | ||
<DESCRIPTION>A test service group</DESCRIPTION> | ||
<MONITORED>Y</MONITORED> | ||
<CONTACT_EMAIL>[email protected]</CONTACT_EMAIL> | ||
<SCOPE>Local</SCOPE> | ||
<!-- | ||
<SERVICE_ENDPOINT> | ||
<HOSTNAME>service-1.site-1.org</HOSTNAME> | ||
<SERVICE_TYPE>CE</SERVICE_TYPE> | ||
<HOST_IP>127.0.0.01</HOST_IP> | ||
<IN_PRODUCTION>Y</IN_PRODUCTION> | ||
<NODE_MONITORED>Y</NODE_MONITORED> | ||
</SERVICE_ENDPOINT> | ||
--> | ||
</SERVICE_GROUP> | ||
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<results> | ||
<SITE> | ||
<PRIMARY_KEY>SITE-PK-1</PRIMARY_KEY> | ||
<SHORT_NAME>SITE-1</SHORT_NAME> | ||
<OFFICIAL_NAME>SITE NUMBER 1</OFFICIAL_NAME> | ||
<SITE_DESCRIPTION>Test site description for Site 1.</SITE_DESCRIPTION> | ||
<HOME_URL>http://www.site-1.org/</HOME_URL> | ||
<CONTACT_EMAIL>[email protected]</CONTACT_EMAIL> | ||
<CSIRT_EMAIL>[email protected]</CSIRT_EMAIL> | ||
<CONTACT_TEL>+12 34 5678 01</CONTACT_TEL> | ||
<COUNTRY_CODE>DK</COUNTRY_CODE> | ||
<COUNTRY>Denmark</COUNTRY> | ||
<ROC>NGI-1</ROC> | ||
<PRODUCTION_INFRASTRUCTURE>Test</PRODUCTION_INFRASTRUCTURE> | ||
<CERTIFICATION_STATUS>Certified</CERTIFICATION_STATUS> | ||
<TIMEZONE>Europe/Zurich</TIMEZONE> | ||
<IP_RANGE>127.0.0.1/127.0.0.99</IP_RANGE> | ||
<CSIRTTEL>+12 34 5678 02</CSIRTTEL> | ||
<EMERGENCYTEL>+12 34 5678 03</EMERGENCYTEL> | ||
<SCOPE>EGI</SCOPE> | ||
<DOMAIN> | ||
<DOMAIN_NAME>site-1.org</DOMAIN_NAME> | ||
</DOMAIN> | ||
<LONGITUDE>-06.47</LONGITUDE> | ||
<LATITUDE>62.00</LATITUDE> | ||
</SITE> | ||
</results> |
Oops, something went wrong.