Skip to content

Commit

Permalink
Update beats framework to 07ed0dabcaab (#3650)
Browse files Browse the repository at this point in the history
  • Loading branch information
graphaelli authored Apr 16, 2020
1 parent e45097f commit bc56b71
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 22 deletions.
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Contents of "LICENSE":
--------------------------------------------------------------------
Dependency: github.com/elastic/beats/v7
Version: v7.0.0
Revision: 387ee122a369
Revision: 07ed0dabcaab
License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Expand Down Expand Up @@ -2561,7 +2561,7 @@ Contents of "LICENSE":

--------------------------------------------------------------------
Dependency: golang.org/x/sys
Revision: 85ca7c5b95cd
Revision: 669c56c373c4
License type (autodetected): BSD-3-Clause
Contents of "LICENSE":

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/client9/misspell v0.3.5-0.20180309020325-c0b55c823952 // indirect
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/dop251/goja v0.0.0-20200309191912-043cf4f34a48 // indirect
github.com/dop251/goja v0.0.0-20200414142002-77e84ffb8c65 // indirect
github.com/dop251/goja_nodejs v0.0.0-20200128125109-2d688c7e0ac4 // indirect
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200325002817-387ee122a369
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200414143427-07ed0dabcaab
github.com/elastic/go-elasticsearch/v7 v7.5.0
github.com/elastic/go-elasticsearch/v8 v8.0.0-20200210103600-aff00e5adfde
github.com/elastic/go-licenser v0.2.1
Expand Down Expand Up @@ -54,9 +54,9 @@ require (
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224 // indirect
golang.org/x/tools v0.0.0-20200414131530-0037cb7812fa // indirect
google.golang.org/grpc v1.27.1
gopkg.in/yaml.v2 v2.2.8
howett.net/plist v0.0.0-20200225050739-77e249a2e2ba // indirect
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200324205625-99f483e5e3fb h1:s2ERZ
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200324205625-99f483e5e3fb/go.mod h1:7LY8sVcdh+T7aAhMJIAfgyQTCOLyubVbk9859Drfxjs=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200325002817-387ee122a369 h1:nzLbKOqA0jPpzCu04EWqoD4VLMSYSMpLo/973wt1K2g=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200325002817-387ee122a369/go.mod h1:7LY8sVcdh+T7aAhMJIAfgyQTCOLyubVbk9859Drfxjs=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200414143427-07ed0dabcaab h1:WckHlzx+7GC4fwjVJjkjYRr7RzBIyzEywl0hubhLLrU=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20200414143427-07ed0dabcaab/go.mod h1:+OYAR7CSMBMZtDD4I0lKwulg6NdJsCMcqHSMjA5B9UU=
github.com/elastic/ecs v1.4.0 h1:BGIUwWJhThRO2IQxzm7ekV9TMUGwZoYyevT5/1xmMf0=
github.com/elastic/ecs v1.4.0/go.mod h1:pgiLbQsijLOJvFR8OTILLu0Ni/R/foUNg0L+T6mU9b4=
github.com/elastic/ecs v1.5.0 h1:/VEIBsRU4ecq2+U3RPfKNc6bFyomP6qnthYEcQZu8GU=
Expand Down Expand Up @@ -978,6 +980,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/gopher-lua v0.0.0-20170403160031-b402f3114ec7/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
go.elastic.co/apm v1.7.0 h1:vd4ncfZ/Y2GIsWW7aFR4uQdqmfUbuHfUhglqOqEwrUI=
go.elastic.co/apm v1.7.0/go.mod h1:IYfi/330rWC5Kfns1rM+kY+RPkIdgUziRF6Cbm9qlxQ=
Expand Down Expand Up @@ -1159,6 +1162,8 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 h1:opSr2sbRXk5X5/givKrrKj9HXxFpW2sdCiP8MJSKLQY=
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1219,6 +1224,8 @@ golang.org/x/tools v0.0.0-20200324201824-1fc30e1f4ccc h1:pdV61EOqqmHmRMCtqTv+eoY
golang.org/x/tools v0.0.0-20200324201824-1fc30e1f4ccc/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224 h1:azwY/v0y0K4mFHVsg5+UrTgchqALYWpqVo6vL5OmkmI=
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200414131530-0037cb7812fa h1:Dj5+XbHrBfDrery2jI1rORnBNTbfuoMUvAfX5JLQ1WE=
golang.org/x/tools v0.0.0-20200414131530-0037cb7812fa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
Expand Down
1 change: 1 addition & 0 deletions script/jenkins/test-install-packages.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -xeuo pipefail

export MAGEFILE_VERBOSE=1
./build/linux/mage -v testPackagesInstall
11 changes: 11 additions & 0 deletions tests/packaging/Dockerfile.aarch64.rpm.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM arm64v8/centos

RUN yum install -y initscripts

ARG apm_server_pkg
COPY $apm_server_pkg $apm_server_pkg
RUN rpm -ivh $apm_server_pkg

COPY test.sh test.sh

CMD ./test.sh
9 changes: 9 additions & 0 deletions tests/packaging/Dockerfile.amd64.deb.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:jessie

ARG apm_server_pkg
COPY $apm_server_pkg $apm_server_pkg
RUN dpkg -i $apm_server_pkg

COPY test.sh test.sh

CMD ./test.sh
9 changes: 9 additions & 0 deletions tests/packaging/Dockerfile.arm64.deb.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM arm64v8/debian

ARG apm_server_pkg
COPY $apm_server_pkg $apm_server_pkg
RUN dpkg -i $apm_server_pkg

COPY test.sh test.sh

CMD ./test.sh
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/packaging/Dockerfile.x86_64.rpm.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM centos:7

RUN yum install -y initscripts

ARG apm_server_pkg
COPY $apm_server_pkg $apm_server_pkg
RUN rpm -ivh $apm_server_pkg

COPY test.sh test.sh

CMD ./test.sh
44 changes: 28 additions & 16 deletions tests/packaging/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,35 @@ var (
files = flag.String("files", "build/distributions/*", "filepath glob containing package files")
)

type package_ struct {
arch,
path string
}

// TestDeb ensures debian packages are created and can be installed
func TestDeb(t *testing.T) {
debs := getFiles(t, regexp.MustCompile(`\.deb$`))
if len(debs) == 0 {
t.Fatal("no debs found")
}
for _, deb := range debs {
checkInstall(t, deb, "Dockerfile.deb.install")
}
testInstall(t, "deb")
}

// TestRpm ensures rpm packages are created and can be installed
func TestRpm(t *testing.T) {
rpms := getFiles(t, regexp.MustCompile(`\.rpm$`))
if len(rpms) == 0 {
t.Fatal("no rpms found")
testInstall(t, "rpm")
}

// (deb|rpm) would remove check that both types of packages are created
func testInstall(t *testing.T, ext string) {
pkgs := getPackages(t, regexp.MustCompile(fmt.Sprintf(`-(\w+)\.%s$`, ext)))
if len(pkgs) == 0 {
t.Fatalf("no %ss found", ext)
}
for _, rpm := range rpms {
checkInstall(t, rpm, "Dockerfile.rpm.install")
for _, pkg := range pkgs {
t.Run(fmt.Sprintf("%s_%s", t.Name(), pkg.arch), func(t *testing.T) {
if pkg.arch == "aarch64" || pkg.arch == "arm64" {
t.Skipf("skipped package install test for %s on %s", ext, pkg.arch)
return
}
checkInstall(t, pkg.path, fmt.Sprintf("Dockerfile.%s.%s.install", pkg.arch, ext))
})
}
}

Expand All @@ -66,15 +78,15 @@ func checkInstall(t *testing.T, pkg, dockerfile string) {
}
}

func getFiles(t *testing.T, pattern *regexp.Regexp) []string {
func getPackages(t *testing.T, pattern *regexp.Regexp) []package_ {
matches, err := filepath.Glob(*files)
if err != nil {
t.Fatal(err)
}
fs := matches[:0]
fs := make([]package_, 0)
for _, f := range matches {
if pattern.MatchString(filepath.Base(f)) {
fs = append(fs, f)
if m := pattern.FindStringSubmatch(filepath.Base(f)); len(m) > 0 {
fs = append(fs, package_{arch: m[1], path: f})
}
}

Expand Down

0 comments on commit bc56b71

Please sign in to comment.