Skip to content

Commit

Permalink
[ci skip] 2020.06.24-9399
Browse files Browse the repository at this point in the history
  • Loading branch information
cybozu-neco committed Jun 24, 2020
2 parents b07ef54 + 4659dc7 commit 0ca76bc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 46 deletions.
7 changes: 6 additions & 1 deletion bin/run-dctest-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ GOPATH=\${HOME}/go
export GOPATH
PATH=/usr/local/go/bin:\${GOPATH}/bin:\${PATH}
export PATH
if [ "${SUITE_NAME}" = "upgrade" ]; then
MACHINES_FILE=/tmp/release/dctest/output/machines.yml
else
MACHINES_FILE=\${GOPATH}/src/github.com/cybozu-go/neco/dctest/output/machines.yml
fi
# Run dctest
cd \${GOPATH}/src/github.com/cybozu-go/neco/dctest
exec make test TAGS=${TAG_NAME} SUITE=${SUITE_NAME}
exec make test TAGS=${TAG_NAME} SUITE=${SUITE_NAME} MACHINES_FILE=\${MACHINES_FILE}
EOF
chmod +x run.sh

Expand Down
5 changes: 3 additions & 2 deletions dctest/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Makefile for neco-test

# configuration variables
OUTPUT = ./output
PLACEMAT = /usr/bin/placemat
GINKGO = env GO111MODULE=on GOFLAGS=-mod=vendor $(GOPATH)/bin/ginkgo --failFast -v
SUITE = ./bootstrap
Expand All @@ -16,8 +17,9 @@ ifeq ($(MENU_ARG),)
else
MENU = $(MENU_ARG)
endif
MACHINES_FILE ?= $(abspath $(OUTPUT)/machines.yml)

export PLACEMAT GINKGO SUITE_PACKAGE
export PLACEMAT GINKGO SUITE_PACKAGE MACHINES_FILE

CUSTOM_UBUNTU = cybozu-ubuntu-18.04-server-cloudimg-amd64.img
CUSTOM_UBUNTU_API_URL = https://api.github.com/repos/cybozu/neco-ubuntu/releases/latest
Expand All @@ -28,7 +30,6 @@ GOFLAGS = -mod=vendor
export GOFLAGS

# non-configuration variables
OUTPUT = ./output
SABAKAN_DIR = $(OUTPUT)/sabakan
DHCP_JSON = $(SABAKAN_DIR)/dhcp.json
AUTOCONFIG = $(SABAKAN_DIR)/auto-config
Expand Down
44 changes: 5 additions & 39 deletions dctest/before.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import (
"strings"
"time"

"sigs.k8s.io/yaml"

"github.com/cybozu-go/log"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"sigs.k8s.io/yaml"
)

const numActiveBootServers = 3
Expand All @@ -24,41 +23,8 @@ func RunBeforeSuite() {
SetDefaultEventuallyPollingInterval(time.Second)
SetDefaultEventuallyTimeout(10 * time.Minute)

// Temporary fix for upgrade test
dummyMachinesYaml := `racks:
- name: rack0
workers:
cs: 2
ss: 1
boot:
bastion: 10.72.48.0/32
- name: rack1
workers:
cs: 2
ss: 0
boot:
bastion: 10.72.48.1/32
- name: rack2
workers:
cs: 1
ss: 0
boot:
bastion: 10.72.48.2/32
- name: rack3
workers:
cs: 1
ss: 0
boot:
bastion: 10.72.48.3/32`

_, err := os.Stat("../output/machines.yml")
var data []byte
if os.IsNotExist(err) {
data = []byte(dummyMachinesYaml)
} else {
data, err = ioutil.ReadFile("../output/machines.yml")
Expect(err).NotTo(HaveOccurred())
}
data, err := ioutil.ReadFile(machinesFile)
Expect(err).NotTo(HaveOccurred())

machines := struct {
Racks []struct {
Expand All @@ -76,11 +42,11 @@ func RunBeforeSuite() {
Expect(err).NotTo(HaveOccurred())

for i, rack := range machines.Racks {
addr := rack.Boot.Bastion[:strings.LastIndex(rack.Boot.Bastion, "/")]
addr := strings.Split(rack.Boot.Bastion, "/")[0]
if i < numActiveBootServers {
bootServers = append(bootServers, addr)
}
allBootServers = append(bootServers, addr)
allBootServers = append(allBootServers, addr)
}

err = prepareSSHClients(allBootServers...)
Expand Down
1 change: 1 addition & 0 deletions dctest/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var (
sshKeyFile = os.Getenv("SSH_PRIVKEY")
bobPublicKey = os.Getenv("BOB_PUBKEY")
bobPrivateKey = os.Getenv("BOB_PRIVKEY")
machinesFile = os.Getenv("MACHINES_FILE")
)

var (
Expand Down
5 changes: 1 addition & 4 deletions ignitions/common/systemd/udev-trigger.service
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[Unit]
Description=Request udev device events
Wants=systemd-udevd.service
After=systemd-udevd-kernel.socket systemd-udevd-control.socket
Before=setup-var.service
PartOf=udev-trigger.timer
DefaultDependencies=no

[Service]
Type=oneshot
Expand Down

0 comments on commit 0ca76bc

Please sign in to comment.