The package rpms/golang-github-Shopify-toxiproxy.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/golang-github-Shopify-toxiproxy.git/....
Change: -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
Thanks.
Full change: ============
commit 985e292debf07e589cb00e0bd27f72218ea7a3d0 Author: Robert-Andr Mauchin zebob.m@gmail.com Date: Mon Oct 29 22:12:23 2018 +0100
Release 2.1.3
diff --git a/.gitignore b/.gitignore index 0f07f8f..a859930 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /toxiproxy-fc5a9c0.tar.gz +/toxiproxy-2.1.3.tar.gz diff --git a/0001-Fix-Fatalf-parameters.patch b/0001-Fix-Fatalf-parameters.patch new file mode 100644 index 0000000..c19f0e1 --- /dev/null +++ b/0001-Fix-Fatalf-parameters.patch @@ -0,0 +1,22 @@ +From 65bbb75e44c0368bcabbe2b1b428f1809993cdc0 Mon Sep 17 00:00:00 2001 +From: Oleg Kovalov iamolegkovalov@gmail.com +Date: Mon, 16 Apr 2018 21:01:46 +0200 +Subject: [PATCH] fix: t.Fatalf parameters + +--- + api_test.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/api_test.go b/api_test.go +index 488f3d1..306c49b 100644 +--- a/api_test.go ++++ b/api_test.go +@@ -323,7 +323,7 @@ func TestPopulateProxyWithBadDataShouldReturnError(t *testing.T) { + + for _, p := range proxies { + if p.Name == "two" || p.Name == "three" { +- t.Fatalf("Proxy %s exists, populate did not fail correctly.") ++ t.Fatalf("Proxy %s exists, populate did not fail correctly.", p.Name) + } + } + }) diff --git a/golang-github-Shopify-toxiproxy.spec b/golang-github-Shopify-toxiproxy.spec index e617db7..9909847 100644 --- a/golang-github-Shopify-toxiproxy.spec +++ b/golang-github-Shopify-toxiproxy.spec @@ -1,166 +1,164 @@ -%if 0%{?fedora} || 0%{?rhel} == 6 -%global with_devel 1 -%global with_bundled 0 -%global with_debug 0 -# timeouts on i686 -%global with_check 0 -%global with_unit_test 1 -%else -%global with_devel 0 -%global with_bundled 0 -%global with_debug 0 -%global with_check 0 -%global with_unit_test 0 -%endif - -%if 0%{?with_debug} -%global _dwz_low_mem_die_limit 0 -%else -%global debug_package %{nil} -%endif +# Run tests in check section +%bcond_without check
-%global provider github -%global provider_tld com -%global project Shopify -%global repo toxiproxy # https://github.com/Shopify/toxiproxy -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} -%global commit fc5a9c009ecc37557c07d223e346fb44ec4c1c00 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - -Name: golang-%{provider}-%{project}-%{repo} -Version: 2.0.0 -Release: 0.7.rc2.git%{shortcommit}%{?dist} +%global goipath github.com/Shopify/toxiproxy +Version: 2.1.3 + +%global common_description %{expand: +Toxiproxy is a framework for simulating network conditions. It's made +specifically to work in testing, CI and development environments, supporting +deterministic tampering with connections, but with support for randomized +chaos and customization. Toxiproxy is the tool you need to prove with tests +that your application doesn't have single points of failure. + +Toxiproxy usage consists of two parts. A TCP proxy written in Go (what this +repository contains) and a client communicating with the proxy over HTTP. You +configure your application to make all test connections go through Toxiproxy +and can then manipulate their health via HTTP. See Usage below on how to set +up your project.} + +%gometa + +Name: golang-github-Shopify-toxiproxy +Release: 1%{?dist} Summary: A proxy to simulate network and system conditions # Detected licences -# - MIT/X11 (BSD like) at 'LICENSE' +# - Expat License at 'LICENSE' License: MIT -URL: https://%%7Bprovider_prefix%7D -Source0: https://%%7Bprovider_prefix%7D/archive/%%7Bcommit%7D/%%7Brepo%7D-%%7Bshortco... - -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} -# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. -BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} +URL: %{gourl} +Source0: %{gosource} +# Stolen from Debian: +Source1: toxiproxy-server.1 +Source2: toxiproxy-cli.1 +Source3: toxiproxy.default +Source4: toxiproxy.service +Source5: toxiproxy.logrotate + +Patch0: https://github.com/Shopify/toxiproxy/commit/65bbb75e44c0368bcabbe2b1b428f180... + +%{?systemd_requires} +BuildRequires: systemd +BuildRequires: golang(github.com/gorilla/context) +BuildRequires: golang(github.com/gorilla/mux) +BuildRequires: golang(github.com/sirupsen/logrus) +BuildRequires: golang(github.com/urfave/cli) +BuildRequires: golang(golang.org/x/crypto/ssh/terminal) +BuildRequires: golang(golang.org/x/sys/unix) +BuildRequires: golang(gopkg.in/tomb.v1) +Requires(pre): shadow-utils
%description -%{summary} +%{common_description}
-%if 0%{?with_devel} -%package devel + +%package -n toxiproxy Summary: %{summary} -BuildArch: noarch
-%if 0%{?with_check} && ! 0%{?with_bundled} -%endif +%description -n toxiproxy +%{common_description} + +This package contains library source intended for +building other packages which use import path with +%{goipath} prefix
-Provides: golang(%{import_path}/client) = %{version}-%{release} + +%package devel +Summary: %{summary} +BuildArch: noarch
%description devel -%{summary} +%{common_description}
This package contains library source intended for building other packages which use import path with -%{import_path} prefix. -%endif +%{goipath} prefix.
-%if 0%{?with_unit_test} && 0%{?with_devel} -%package unit-test-devel -Summary: Unit tests for %{name} package -%if 0%{?with_check} -#Here comes all BuildRequires: PACKAGE the unit tests -#in %%check section need for running -%endif
-# test subpackage tests code from devel subpackage -Requires: %{name}-devel = %{version}-%{release} +%prep +%forgeautosetup -p1
-%if 0%{?with_check} && ! 0%{?with_bundled} -BuildRequires: golang(github.com/Sirupsen/logrus) -BuildRequires: golang(gopkg.in/tomb.v1) -BuildRequires: golang(github.com/gorilla/mux) -%endif +rm -rf vendor/
-Requires: golang(github.com/Sirupsen/logrus) -Requires: golang(gopkg.in/tomb.v1) -Requires: golang(github.com/gorilla/mux)
-%description unit-test-devel -%{summary} +%build +%gobuildroot +export LDFLAGS="-X github.com/Shopify/toxiproxy.Version=%{version}" +%gobuild -o _bin/toxiproxy-cli %{goipath}/cli +%gobuild -o _bin/toxiproxy-server %{goipath}/cmd
-This package contains unit tests for project -providing packages with %{import_path} prefix. -%endif
-%prep -%setup -q -n %{repo}-%{commit} +%install +%goinstall +install -Dpm 0755 _bin/toxiproxy-cli %{buildroot}%{_bindir}/toxiproxy-cli +install -Dpm 0755 _bin/toxiproxy-server %{buildroot}%{_bindir}/toxiproxy-server
-%build +install -d -m 0755 %{buildroot}%{_mandir}/man1 +install -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/toxiproxy-server.1 +install -p -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/toxiproxy-cli.1
-%install -# source codes for building projects -%if 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list -# find all *.go but no *_test.go files and generate devel.file-list -for file in $(find . -iname "*.go" ! -iname "*_test.go" | grep -v "./Godeps/_workspace/src") ; do - echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list -done -%endif +install -d -m 0755 %{buildroot}%{_sysconfdir}/default +install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/default/toxiproxy
-# testing files for this project -%if 0%{?with_unit_test} && 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -# find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go" | grep -v "./Godeps/_workspace/src") ; do - echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list -done -%endif +install -d -m 0755 %{buildroot}%{_unitdir} +install -p -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/toxiproxy.service
-%if 0%{?with_devel} -sort -u -o devel.file-list devel.file-list -%endif +install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d +install -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/toxiproxy
+install -d -m 0755 %{buildroot}%{_sharedstatedir}/toxiproxy +install -d -m 0755 %{buildroot}%{_localstatedir}/log/toxiproxy + + +%if %{with check} %check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%if ! 0%{?with_bundled} -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%else -export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} +%gochecks %endif
-%if ! 0%{?gotest:1} -%global gotest go test -%endif
-%gotest %{import_path} -%gotest %{import_path}/testing -%endif +%pre +getent group toxiproxy >/dev/null || groupadd -r toxiproxy +getent passwd toxiproxy >/dev/null || \ + useradd -r -g toxiproxy -d %{_sharedstatedir}/toxiproxy -s /sbin/nologin \ + -c "Toxiproxy-server account" toxiproxy +exit 0
-#define license tag if not already defined -%{!?_licensedir:%global license %doc}
-%if 0%{?with_devel} -%files devel -f devel.file-list +%post +%systemd_post toxiproxy.service + + +%preun +%systemd_preun toxiproxy.service + + +%postun +%systemd_postun_with_restart toxiproxy.service + + +%files -n toxiproxy %license LICENSE -%doc CHANGELOG.md README.md -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif +%doc README.md +%{_bindir}/toxiproxy-cli +%{_bindir}/toxiproxy-server +%config(noreplace) %{_sysconfdir}/default/toxiproxy +%config(noreplace) %{_sysconfdir}/logrotate.d/toxiproxy +%{_unitdir}/toxiproxy.service +%{_mandir}/man1/toxiproxy-server.1.* +%{_mandir}/man1/toxiproxy-cli.1.* +%attr(0775,root,toxiproxy) %dir %{_localstatedir}/log/toxiproxy +%attr(0750,toxiproxy,toxiproxy) %dir %{_sharedstatedir}/toxiproxy
-%if 0%{?with_unit_test} && 0%{?with_devel} -%files unit-test-devel -f unit-test-devel.file-list + +%files devel -f devel.file-list %license LICENSE -%doc CHANGELOG.md README.md -%endif +%doc README.md CREATING_TOXICS.md CHANGELOG.md +
%changelog +* Mon Oct 29 2018 Robert-Andr Mauchin zebob.m@gmail.com - 2.1.3-1 +- Release 2.1.3 + * Fri Jul 13 2018 Fedora Release Engineering releng@fedoraproject.org - 2.0.0-0.7.rc2.gitfc5a9c0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
@@ -182,3 +180,4 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} * Fri Apr 15 2016 jchaloup jchaloup@redhat.com - 2.0.0-0.1.rc2.gitfc5a9c0 - First package for Fedora resolves: #1327753 + diff --git a/sources b/sources index 8a9f541..6c2023f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7a8a23879f3f631838391fe6984cc2da toxiproxy-fc5a9c0.tar.gz +SHA512 (toxiproxy-2.1.3.tar.gz) = cdbd397c6633c6b8ac1257762da2e0f7c8d655b74e49c235fb96e5633fc5a7dfa664fc91c354aec418ce16ad1ca705fa56ffdbb0a0310e83e36c8fe4762fc686 diff --git a/toxiproxy-cli.1 b/toxiproxy-cli.1 new file mode 100644 index 0000000..5548d83 --- /dev/null +++ b/toxiproxy-cli.1 @@ -0,0 +1,40 @@ +." Manpage for toxiproxy-cli +." Contact aviau@debian.org to correct errors or typos. +.TH man 8 "26 June 2016" "1.0" "toxiproxy-cli man page" +.SH NAME +toxiproxy-cli - simulate network and system conditions +.SH SYNOPSIS +toxiproxy-cli [global options] command [command options] [arguments...] +.SH DESCRIPTION +Toxiproxy is a framework for simulating network conditions. It's made specifically to work in testing, CI and development environments, supporting deterministic tampering with connections, but with support for randomized chaos and customization. +.SH GLOBAL OPTIONS +.TP +.B --help, -h +show help +.TP +.B --version, -v +print the version +.SH COMMANDS +.TP +.B list, l, li, ls +list all proxies +.TP +.B inspect, i, ins +inspect a single proxy +.TP +.B create, c, new +create a new proxy +.TP +.B toggle, tog +toggle enabled status on a proxy +.TP +.B delete, d +delete a proxy +.TP +.B toxic, t +add, remove or update a toxic +.TP +.B help, h +Shows a list of commands or help for one command +.SH AUTHOR +Alexandre Viau (aviau@debian.org) diff --git a/toxiproxy-server.1 b/toxiproxy-server.1 new file mode 100644 index 0000000..01a5a51 --- /dev/null +++ b/toxiproxy-server.1 @@ -0,0 +1,20 @@ +." Manpage for toxiproxy-server. +." Contact alexandre@alexandreviau.net to correct errors or typos. +.TH man 8 "07 August 2015" "1.0" "toxiproxy-server man page" +.SH NAME +toxiproxy-server - proxy to simulate network and system conditions +.SH SYNOPSIS +toxiproxy-server [options] +.SH DESCRIPTION +Toxiproxy is a framework for simulating network conditions. It's made specifically to work in testing, CI and development environments, supporting deterministic tampering with connections, but with support for randomized chaos and customization. +.SH OPTIONS +.B -host <host> +Host for toxiproxy's API to listen on +.TP +.B -port <port> +Port for toxiproxy's API to listen on +.TP +.B -seed <seed> +Seed for randomizing toxics with +.SH AUTHOR +Alexandre Viau (alexandre@alexandreviau.net) diff --git a/toxiproxy.default b/toxiproxy.default new file mode 100644 index 0000000..727e613 --- /dev/null +++ b/toxiproxy.default @@ -0,0 +1,4 @@ +# toxiproxy configuration options +TOXIPROXY_PORT="8474" +TOXIPROXY_HOST="localhost" +#TOXIPROXY_OPTS="" diff --git a/toxiproxy.logrotate b/toxiproxy.logrotate new file mode 100644 index 0000000..e32c845 --- /dev/null +++ b/toxiproxy.logrotate @@ -0,0 +1,6 @@ +/var/log/toxiproxy/*log { + missingok # If the log file is missing, go on to the next one without issuing an error message + notifempty # Don't do any rotation if the logfile is empty + compress # Compress older files with gzip + delaycompress # Don't compress yesterdays files +} diff --git a/toxiproxy.service b/toxiproxy.service new file mode 100644 index 0000000..c907fa9 --- /dev/null +++ b/toxiproxy.service @@ -0,0 +1,13 @@ +[Unit] +Description=toxiproxy is a proxy to simulate network and system conditions +After=network.target +Documentation=man:toxiproxy-server(1) + +[Service] +User=toxiproxy +Group=toxiproxy +EnvironmentFile=/etc/default/toxiproxy +ExecStart=/usr/bin/toxiproxy-server -port $TOXIPROXY_PORT -host $TOXIPROXY_HOST $TOXIPROXY_OPTS + +[Install] +WantedBy=multi-user.target