Skip to content

Commit

Permalink
JPERF-273: Assert JiraInstance access
Browse files Browse the repository at this point in the history
  • Loading branch information
dagguh committed Sep 11, 2023
1 parent 4eea592 commit 0b3c72c
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class JiraPlanIT {
val dataCenter = dcPlan.materialize()

// then
assertJiraAccessible(dataCenter)
dataCenter.nodes.forEach { node ->
val installed = node.installed
val serverXml = installed
Expand All @@ -84,12 +85,7 @@ class JiraPlanIT {
.download(Files.createTempFile("downloaded-config", ".xml"))
assertThat(serverXml.readText()).contains("<Connector port=\"${installed.http.tcp.port}\"")
assertThat(node.pid).isPositive()
val fakeVu = infrastructure.serveSsh()
fakeVu.newConnection().use { ssh ->
ssh.execute("wget ${dataCenter.address.addressPrivately()}")
}
}
dataCenter.address.addressPublicly().toURL().readText()
}


Expand Down Expand Up @@ -186,6 +182,7 @@ class JiraPlanIT {
val reports = jiraServerPlan.report().downloadTo(Files.createTempDirectory("jira-server-plan-"))

// then
assertJiraAccessible(jiraServer)
val theNode = jiraServer.nodes.single()
val serverXml = theNode
.installed
Expand Down Expand Up @@ -216,6 +213,15 @@ class JiraPlanIT {
}
}

private fun assertJiraAccessible(jira: JiraInstance) {
val fakeVu = infrastructure.serveSsh()
fakeVu.newConnection().use { ssh ->
ssh.execute("wget ${jira.address.addressPrivately()}")
}
val response = jira.address.addressPublicly().toURL().readText()
assertThat(response).contains("<body")
}

private fun debug(
jiraServerPlan: JiraInstancePlan,
e: Exception
Expand Down

0 comments on commit 0b3c72c

Please sign in to comment.