tests - fix LinuxTest setup and init work on integrating examples with the new test system

This commit is contained in:
bunkerity 2022-07-20 14:47:23 +02:00
parent c02d888b32
commit d8c8ceab36
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
9 changed files with 88 additions and 2 deletions

View File

@ -0,0 +1,24 @@
{
"name": "autoconf-configs",
"kinds": [
"autoconf"
],
"timeout": 60,
"tests": [
{
"type": "string",
"url": "https://app1.example.com/hello",
"string": "app1"
},
{
"type": "string",
"url": "https://app2.example.com/hello",
"string": "app2"
},
{
"type": "string",
"url": "https://app3.example.com/hello",
"string": "app3"
}
]
}

View File

@ -0,0 +1,24 @@
{
"name": "autoconf-php",
"kinds": [
"autoconf"
],
"timeout": 60,
"tests": [
{
"type": "string",
"url": "https://app1.example.com",
"string": "app1"
},
{
"type": "string",
"url": "https://app2.example.com",
"string": "app2"
},
{
"type": "string",
"url": "https://app3.example.com",
"string": "app3"
}
]
}

View File

@ -0,0 +1,24 @@
{
"name": "autoconf-reverse-proxy",
"kinds": [
"autoconf"
],
"timeout": 60,
"tests": [
{
"type": "string",
"url": "https://app1.example.com",
"string": "hello"
},
{
"type": "string",
"url": "https://app2.example.com",
"string": "hello"
},
{
"type": "string",
"url": "https://app3.example.com",
"string": "hello"
}
]
}

View File

@ -0,0 +1,14 @@
{
"name": "behind-reverse-proxy",
"kinds": [
"docker"
],
"timeout": 60,
"tests": [
{
"type": "string",
"url": "http://www.example.com",
"string": "hello"
}
]
}

View File

@ -88,10 +88,10 @@ class LinuxTest(Test) :
Test.replace_in_files(test, "example.com", getenv("ROOT_DOMAIN"))
setup = test + "/setup-linux.sh"
if isfile(setup) :
proc = LinuxTest.docker_cp(self.__distro, test, "/opt/tests")
proc = LinuxTest.docker_cp(self.__distro, test, "/opt/" + self._name)
if proc.returncode != 0 :
raise(Exception("docker cp failed (linux stack)"))
proc = LinuxTest.docker_exec(self.__distro, "cd /opt/tests/ && ./setup-linux.sh")
proc = LinuxTest.docker_exec(self.__distro, "cd /opt/" + self._name + " && ./setup-linux.sh")
if proc.returncode != 0 :
raise(Exception("docker exec setup failed (linux stack)"))
proc = LinuxTest.docker_exec(self.__distro, "systemctl restart bunkerweb")