Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9577702
D1967.id4972.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1967.id4972.diff
View Options
diff --git a/PaaSDockerTest.php b/PaaSDockerTest.php
new file mode 100644
--- /dev/null
+++ b/PaaSDockerTest.php
@@ -0,0 +1,29 @@
+<?php
+
+require_once 'traits/assertHttp.php';
+require_once 'utils/OperationsConfiguration.php';
+
+use Nasqueron\Infrastructure\OperationsConfiguration;
+
+class PaaSDockerTest extends PHPUnit\Framework\TestCase {
+
+ use assertHttp;
+
+ /**
+ * @dataProvider provideDockerDomains
+ */
+ public function test502Pages (string $domain) : void {
+ $url = "https://$domain/502.html";
+
+ $this->assertHttpResponseCode(200, $url);
+ }
+
+ public function provideDockerDomains () : iterable {
+ $domains = OperationsConfiguration::getDockerDomains();
+
+ foreach ($domains as $domain) {
+ yield [$domain];
+ }
+ }
+
+}
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -3,7 +3,8 @@
"description": "Tests to validate production environment",
"type": "project",
"require": {
- "phpunit/phpunit": "^7.3"
+ "phpunit/phpunit": "^7.3",
+ "ext-yaml": "*"
},
"license": "BSD-2-Clause",
"authors": [
diff --git a/utils/OperationsConfiguration.php b/utils/OperationsConfiguration.php
new file mode 100644
--- /dev/null
+++ b/utils/OperationsConfiguration.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Nasqueron\Infrastructure;
+
+class OperationsConfiguration {
+
+ const PILLAR_BASE = "https://raw.githubusercontent.com/nasqueron/operations/master/pillar/";
+
+ public static function getDockerDomains () : array {
+ $domains = [];
+
+ $pillar = self::readPillarFile("paas/docker.sls");
+ foreach ($pillar['docker_containers'] as $server => $instances) {
+ foreach ($instances as $service => $containers) {
+ foreach ($containers as $container => $instance) {
+ if (isset($instance['host'])) {
+ $domains[] = $instance['host'];
+ }
+ }
+ }
+ }
+
+ return $domains;
+ }
+
+ public static function readPillarFile ($path) : iterable {
+ $url = self::PILLAR_BASE . $path;
+ $yaml = file_get_contents($url);
+
+ return yaml_parse($yaml);
+ }
+
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 9, 13:01 (13 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2716619
Default Alt Text
D1967.id4972.diff (2 KB)
Attached To
Mode
D1967: Hunt missing 502 pages for Docker services
Attached
Detach File
Event Timeline
Log In to Comment