-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Altered internal dashboard's App Kernel Walltime and Schedule to use …
…NewRest stack instead of old REST AKRR.
- Loading branch information
Showing
10 changed files
with
128 additions
and
1,894 deletions.
There are no files selected for viewing
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
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,7 @@ | ||
The integration test framework is designed to be used to run tests against | ||
an installed and working XDMoD instance. | ||
|
||
The test harness in the xdmod repository must be configured correctly as | ||
per the instructions in the readme file: xdmod/open_xdmod/modules/xdmod/integration_tests/README.md | ||
|
||
Run the tests with ./runtests.sh |
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,20 @@ | ||
<?php | ||
|
||
$dir = __DIR__; | ||
|
||
// Autoloader for main framework test classes. | ||
spl_autoload_register( | ||
function ($className) use ($dir) { | ||
$classPath | ||
= $dir | ||
. '/../../../xdmod/open_xdmod/modules/xdmod/integration_tests/lib/' | ||
. str_replace('\\', '/', $className) | ||
. '.php'; | ||
|
||
if (is_readable($classPath)) { | ||
return require_once $classPath; | ||
} else { | ||
return false; | ||
} | ||
} | ||
); |
67 changes: 67 additions & 0 deletions
67
tests/integration_tests/lib/REST/internal_dashboard/DashboardAppKernelTest.php
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,67 @@ | ||
<?php | ||
|
||
namespace IntegrationTests\REST\internal_dashboard; | ||
|
||
class DashboardAppKernelTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function __construct() | ||
{ | ||
$xdmodConfig = array( "decodetextasjson" => true ); | ||
$this->xdmodhelper = new \TestHarness\XdmodTestHelper($xdmodConfig); | ||
|
||
$this->endpoint = 'rest/v0.1/akrr/'; | ||
$this->xdmodhelper->authenticate("mgr"); | ||
} | ||
|
||
private function validateAkrrResourceEntries($searchparams) | ||
{ | ||
$this->xdmodhelper->authenticate("mgr"); | ||
|
||
$result = $this->xdmodhelper->get($this->endpoint . 'resources', $searchparams); | ||
$this->assertEquals(200, $result[1]['http_code']); | ||
|
||
$this->assertArrayHasKey('success', $result[0]); | ||
$this->assertEquals($result[0]['success'], true); | ||
|
||
$data = $result[0]['data']; | ||
foreach ($data as $item) { | ||
$this->assertArrayHasKey('id', $item); | ||
$this->assertArrayHasKey('name', $item); | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
public function testResourceNullParam() | ||
{ | ||
$data = $this->validateAkrrResourceEntries(null); | ||
$this->assertGreaterThanOrEqual(1, sizeof($data)); | ||
} | ||
|
||
private function validateAkrrKernelEntries($searchparams) | ||
{ | ||
$this->xdmodhelper->authenticate("mgr"); | ||
|
||
$result = $this->xdmodhelper->get($this->endpoint . 'kernels', $searchparams); | ||
$this->assertEquals(200, $result[1]['http_code']); | ||
|
||
$this->assertArrayHasKey('message', $result[0]); | ||
$this->assertEquals($result[0]['message'], 'success'); | ||
|
||
$data = $result[0]['data']; | ||
foreach ($data as $item) { | ||
$this->assertArrayHasKey('nodes_list', $data[0]); | ||
$this->assertArrayHasKey('name', $data[0]); | ||
$this->assertArrayHasKey('enabled', $data[0]); | ||
$this->assertArrayHasKey('id', $data[0]); | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
public function testKernelNullParam() | ||
{ | ||
$data = $this->validateAkrrKernelEntries(null); | ||
$this->assertGreaterThanOrEqual(1, sizeof($data)); | ||
} | ||
} |
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,21 @@ | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd" | ||
backupGlobals="true" | ||
backupStaticAttributes="false" | ||
bootstrap="bootstrap.php" | ||
cacheTokens="true" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
forceCoversAnnotation="false" | ||
mapTestClassNameToCoveredClassName="false" | ||
printerClass="PHPUnit_TextUI_ResultPrinter" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" | ||
verbose="true"> | ||
</phpunit> |
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,5 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
phpunit `dirname $0` |