[arch-commits] Commit in consul/trunk (PKGBUILD disable-broken-api-test.patch)

Thore Bödecker foxxx0 at archlinux.org
Fri Sep 14 13:11:34 UTC 2018


    Date: Friday, September 14, 2018 @ 13:11:33
  Author: foxxx0
Revision: 380894

upgpkg: consul 1.2.3-1

update to 1.2.3, fix testsuite, fix FS#59350

Modified:
  consul/trunk/PKGBUILD
Deleted:
  consul/trunk/disable-broken-api-test.patch

-------------------------------+
 PKGBUILD                      |   56 +++++++-----------
 disable-broken-api-test.patch |  118 ----------------------------------------
 2 files changed, 22 insertions(+), 152 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-09-14 13:11:30 UTC (rev 380893)
+++ PKGBUILD	2018-09-14 13:11:33 UTC (rev 380894)
@@ -2,31 +2,30 @@
 # Maintainer: Felix Yan <felixonmars at archlinux.org>
 
 pkgname=consul
-pkgver=1.2.2
+pkgver=1.2.3
 pkgrel=1
 pkgdesc="A tool for service discovery, monitoring and configuration."
 arch=('x86_64')
-_gocli_commit='65fcae5817c8600da98ada9d7edf26dd1a84837b' # HEAD
+_gocli_commit='3d22a244be8aa6fb16ac24af0e195c08b7d973aa' # HEAD
 url="https://www.consul.io"
 license=('MPL2')
 depends=('glibc')
-makedepends=('git' 'go-pie' 'procps-ng' 'syslog-ng' 'zip')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/consul/archive/v$pkgver.tar.gz"
-        "git+https://github.com/mitchellh/cli#commit=${_gocli_commit}"
+makedepends=('git' 'go-pie' 'procps-ng' 'zip')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/hashicorp/consul/archive/v${pkgver}.tar.gz"
+        "gocli::git+https://github.com/mitchellh/cli#commit=${_gocli_commit}"
         'consul.service'
         'consul.default'
         'consul.sysusers'
         'example.json'
-        'disable-broken-api-test.patch'
         'fix-build-version-info.patch')
 install=consul.install
-sha512sums=('715f69e7b36d0070ea4e602dc50f51aa2547dbbbbb07cce985da79d1e201c6e84dade8a7c810e3602f88cfbd30e063669076954d2541810a18a0c9e7c9ff8458'
+backup=('etc/default/consul')
+sha512sums=('71a7dbfc031df4a96faf2ddd829f289e96adefd0e0087208bbdd26e742a24e3da05fceea4181eb915703ad3323ed5b02bf74eb3fdfbed1e9a1afa2f74acb2a34'
             'SKIP'
             'c70b9d1556f6c7ecb2e915ab685f289cef0e31198bd2e50c74a0483bbfb387beec67334f539a90adbf68b61b07946e98b300ab8a8e26e53b35f4ab4894adeb04'
             'ec5a800529a297c709fa383c094ecf106351cf0f8ac7b613b972d415d77fe001088902d7ab805e63e78a8e6360323fec1b795db5a4446df1e21b9b4ed31e7079'
             'ef872aedb2bc022a29292b7972a792b22e684c1ccb904a2b2cfec6d8966c28fb19be1452ce060821c419f1b646b236ba2e783175595e4bb6926d164c27a15c87'
             'c4292b8f56ee955ed7385a49843fd90d6434029891b3e1e724cb2fc841514c06e2554a26d3937c114371b18c2168c4e64319eb2cbd726ee8b35870df19089348'
-            'ad5b5ea1fd4ec443c98a89da9fb581d32894c4583dec3707ce9096ed45706bc800f8eb20e5a0c68f6de437d228e09a97bad5815b5bba9b18ae339bcf9a42f8f7'
             '6709e51ff57fbe8118e7c9b38c99ef096a62d0c88ac2694e8c86065052cd2600f65dd9ac7f4a7e60712c26d15355f938cd9d98684955f4a02b2d5adfe1c2c04e')
 
 prepare() {
@@ -35,49 +34,38 @@
   mkdir -p "src/github.com/mitchellh"
   mkdir -p "src/github.com/hashicorp"
 
-  mv "${pkgname}-${pkgver}" "src/github.com/hashicorp/${pkgname}"
-  mv "cli" "src/github.com/mitchellh/cli"
+  mv "${pkgname}-${pkgver}" "${srcdir}/src/github.com/hashicorp/${pkgname}"
+  mv "gocli" "${srcdir}/src/github.com/mitchellh/cli"
 
-  cd "src/github.com/hashicorp/${pkgname}"
+  cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
 
   # use proper release build version string (w/o '-dev' suffix)
   patch -p1 -N -l -i "${srcdir}/fix-build-version-info.patch"
-}
 
-check() {
-  cd "src/github.com/hashicorp/${pkgname}"
-  # TODO: debug failing tests
-  #       + TestTombstoneGC
-  #rm ./agent/consul/state/tombstone_gc_test.go
-  #       + TestAPI_ClientTLSOptions
-  #patch -p0 ./api/api_test.go < "${srcdir}/disable-broken-api-test.patch"
-  #       + TestSyslogFilter (need to start syslog-ng within the chroot container)
-  #rm ./logger/syslog_test.go
-  make test
+  # disable syslog test (requires running syslog service)
+  rm ./logger/syslog_test.go
 }
 
 build() {
-  cd "src/github.com/hashicorp/${pkgname}"
-  # build local arch only, from: https://github.com/hashicorp/consul/#developing-consul
-  # note! this will result in a development build! do not use for production
-  # CONSUL_DEV=1 make
+  cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
+  # weird race conditions when being run with more than 1 thread...
+  taskset --cpu-list 0 make linux
+}
 
-  # this will limit the build targets but still result in official "zip" release
-  # XC_OS='linux' XC_ARCH='amd64' make
-
-  # this will build only for linux/amd64
-  export CGO_ENABLED=0
-  make linux
+check() {
+  cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
+  # weird race conditions when being run with more than 1 thread...
+  taskset --cpu-list 0 make test
 }
 
 package() {
-  cd "src/github.com/hashicorp/${pkgname}"
+  cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
 
   install -D -d -m750 -o 208 -g 208 "${pkgdir}/var/lib/consul"
   install -D -d -m750 -o   0 -g 208 "${pkgdir}/etc/consul.d"
 
   install -D -m644 "${srcdir}/consul.default" "${pkgdir}/etc/default/consul"
-  install -D -m640 -o 0 -g 208 "${srcdir}/example.json" "${pkgdir}/etc/consul.d/example.json"
+  install -D -m644 -o 0 -g 0 "${srcdir}/example.json" "${pkgdir}/usr/share/doc/consul/config.example.json"
   install -Dm755 "bin/consul" "${pkgdir}/usr/bin/consul"
 
   install -Dm644 "${srcdir}/consul.service" "${pkgdir}/usr/lib/systemd/system/consul.service"

Deleted: disable-broken-api-test.patch
===================================================================
--- disable-broken-api-test.patch	2018-09-14 13:11:30 UTC (rev 380893)
+++ disable-broken-api-test.patch	2018-09-14 13:11:33 UTC (rev 380894)
@@ -1,118 +0,0 @@
---- ./api/api_test.go	2017-09-08 18:43:36.000000000 +0200
-+++ /tmp/api_test.go	2017-09-13 16:20:25.950467396 +0200
-@@ -253,115 +253,6 @@
- 	}
- }
- 
--func TestAPI_ClientTLSOptions(t *testing.T) {
--	t.Parallel()
--	// Start a server that verifies incoming HTTPS connections
--	_, srvVerify := makeClientWithConfig(t, nil, func(conf *testutil.TestServerConfig) {
--		conf.CAFile = "../test/client_certs/rootca.crt"
--		conf.CertFile = "../test/client_certs/server.crt"
--		conf.KeyFile = "../test/client_certs/server.key"
--		conf.VerifyIncomingHTTPS = true
--	})
--	defer srvVerify.Stop()
--
--	// Start a server without VerifyIncomingHTTPS
--	_, srvNoVerify := makeClientWithConfig(t, nil, func(conf *testutil.TestServerConfig) {
--		conf.CAFile = "../test/client_certs/rootca.crt"
--		conf.CertFile = "../test/client_certs/server.crt"
--		conf.KeyFile = "../test/client_certs/server.key"
--		conf.VerifyIncomingHTTPS = false
--	})
--	defer srvNoVerify.Stop()
--
--	// Client without a cert
--	t.Run("client without cert, validation", func(t *testing.T) {
--		client, err := NewClient(&Config{
--			Address: srvVerify.HTTPSAddr,
--			Scheme:  "https",
--			TLSConfig: TLSConfig{
--				Address: "consul.test",
--				CAFile:  "../test/client_certs/rootca.crt",
--			},
--		})
--		if err != nil {
--			t.Fatal(err)
--		}
--
--		// Should fail
--		_, err = client.Agent().Self()
--		if err == nil || !strings.Contains(err.Error(), "bad certificate") {
--			t.Fatal(err)
--		}
--	})
--
--	// Client with a valid cert
--	t.Run("client with cert, validation", func(t *testing.T) {
--		client, err := NewClient(&Config{
--			Address: srvVerify.HTTPSAddr,
--			Scheme:  "https",
--			TLSConfig: TLSConfig{
--				Address:  "consul.test",
--				CAFile:   "../test/client_certs/rootca.crt",
--				CertFile: "../test/client_certs/client.crt",
--				KeyFile:  "../test/client_certs/client.key",
--			},
--		})
--		if err != nil {
--			t.Fatal(err)
--		}
--
--		// Should succeed
--		_, err = client.Agent().Self()
--		if err != nil {
--			t.Fatal(err)
--		}
--	})
--
--	// Client without a cert
--	t.Run("client without cert, no validation", func(t *testing.T) {
--		client, err := NewClient(&Config{
--			Address: srvNoVerify.HTTPSAddr,
--			Scheme:  "https",
--			TLSConfig: TLSConfig{
--				Address: "consul.test",
--				CAFile:  "../test/client_certs/rootca.crt",
--			},
--		})
--		if err != nil {
--			t.Fatal(err)
--		}
--
--		// Should succeed
--		_, err = client.Agent().Self()
--		if err != nil {
--			t.Fatal(err)
--		}
--	})
--
--	// Client with a valid cert
--	t.Run("client with cert, no validation", func(t *testing.T) {
--		client, err := NewClient(&Config{
--			Address: srvNoVerify.HTTPSAddr,
--			Scheme:  "https",
--			TLSConfig: TLSConfig{
--				Address:  "consul.test",
--				CAFile:   "../test/client_certs/rootca.crt",
--				CertFile: "../test/client_certs/client.crt",
--				KeyFile:  "../test/client_certs/client.key",
--			},
--		})
--		if err != nil {
--			t.Fatal(err)
--		}
--
--		// Should succeed
--		_, err = client.Agent().Self()
--		if err != nil {
--			t.Fatal(err)
--		}
--	})
--}
--
- func TestAPI_SetQueryOptions(t *testing.T) {
- 	t.Parallel()
- 	c, s := makeClient(t)



More information about the arch-commits mailing list