Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Commit

Permalink
Make tests use .localhost.localdomain hostnames
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
  • Loading branch information
puiterwijk committed Feb 11, 2019
1 parent da87152 commit 45bca52
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: go
# We modify /etc/hosts
sudo: true
sudo: false
git:
# We need the full repo for the metatest
depth: false
Expand All @@ -23,8 +22,6 @@ go_import_path: repospanner.org/repospanner
# In no way would I suggest doing curl | sh normally.... But it's not my environment
install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
before_script:
- echo "127.0.0.1 node1.regiona.repospanner.local node2.regiona.repospanner.local node3.regiona.repospanner.local" | sudo tee -a /etc/hosts
script:
- dep ensure
- ./build.sh -tags prof
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Or, again, start the `repospanner.service` unit file.
Repository access
-----------------

After this, the service will be available on https://<node.fqdn>/
For git repo pull/push, add a /repo/<repo-name>.git.
After this, the service will be available on https://<node.fqdn>/

For git repo pull/push, add a /repo/<repo-name>.git.
Example clone command for default https port on tcp/443 and repo name being "test"

```
Expand Down Expand Up @@ -120,11 +120,7 @@ install the protobuf compiler:

Then run `go generate ./...` to regenerate the built files.

To run the full test suite, first make sure you have a /etc/hosts entry with:

127.0.0.1 node1.regiona.repospanner.local node2.regiona.repospanner.local node3.regiona.repospanner.local

Then to actually run all tests, run from the main directory:
To run the full test suite, run from the main directory:

$ go test ./...

Expand Down
12 changes: 9 additions & 3 deletions functional_tests/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func setBinaryPaths(t tester) {
}

const (
testCluster = "repospanner.local"
testRegion = "regiona"
testCluster = "localdomain"
testRegion = "localhost"

insecureKeysFlag = "--very-insecure-weak-keys"
skipNameConstraintFlag = "--no-name-constraint"
Expand Down Expand Up @@ -630,7 +630,7 @@ func createTestConfig(t tester, node string, nodenr nodeNrType, extras ...string
examplecfg = strings.Replace(
examplecfg,
"/ca/public.",
"/ca/nodea.regiona.",
"/ca/nodea.localhost.",
-1,
)
examplecfg = strings.Replace(
Expand All @@ -651,6 +651,12 @@ func createTestConfig(t tester, node string, nodenr nodeNrType, extras ...string
node,
-1,
)
examplecfg = strings.Replace(
examplecfg,
"regiona",
testRegion,
-1,
)
examplecfg = strings.Replace(
examplecfg,
"paranoid: false",
Expand Down
6 changes: 3 additions & 3 deletions functional_tests/multi_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
func nodeInfoVerification(t *testing.T, node nodeNrType) {
nodeinfo, _ := _runCommand(t, node.Name(), "admin", "nodestatus", "--json")
t.Log("Node info: ", nodeinfo)
if !strings.Contains(nodeinfo, "https://node1.regiona.repospanner.local:1444") {
if !strings.Contains(nodeinfo, "https://node1.localhost.localdomain:1444") {
t.Error("Node A url not in node info")
}
if !strings.Contains(nodeinfo, "https://node2.regiona.repospanner.local:2444") {
if !strings.Contains(nodeinfo, "https://node2.localhost.localdomain:2444") {
t.Error("Node B url not in node info")
}
if !strings.Contains(nodeinfo, "https://node3.regiona.repospanner.local:3444") {
if !strings.Contains(nodeinfo, "https://node3.localhost.localdomain:3444") {
t.Error("Node C url not in node info")
}
}
Expand Down

0 comments on commit 45bca52

Please sign in to comment.