Accepting request 455093 from home:cyphar:containers
- Update to umoci v0.0.0. OBS-URL: https://build.opensuse.org/request/show/455093 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/umoci?expand=0&rev=6
This commit is contained in:
parent
a824efe877
commit
dc3cba615b
6
_service
6
_service
@ -1,10 +1,10 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="url">https://github.com/cyphar/umoci</param>
|
||||
<param name="url">https://github.com/openSUSE/umoci</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="filename">umoci</param>
|
||||
<param name="versionformat">0.0.0~rc3</param>
|
||||
<param name="revision">v0.0.0-rc3</param>
|
||||
<param name="versionformat">0.0.0</param>
|
||||
<param name="revision">v0.0.0</param>
|
||||
<param name="exclude">.git</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
|
@ -1,78 +0,0 @@
|
||||
From 14526d3d910260bb9e0b0aebe6e195dc5daf2b7e Mon Sep 17 00:00:00 2001
|
||||
From: Aleksa Sarai <asarai@suse.com>
|
||||
Date: Tue, 20 Dec 2016 18:20:05 +1100
|
||||
Subject: [PATCH] makefile: make local-unit-tests work as root and non-root
|
||||
|
||||
This is necessary for %check-style testing inside the openSUSE RPMs, so
|
||||
that we can make sure that everything works (or appears to work) when
|
||||
releasing packages.
|
||||
|
||||
It also increases unit test coverage for the rootless case.
|
||||
|
||||
Signed-off-by: Aleksa Sarai <asarai@suse.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
oci/cas/dir_test.go | 10 ++++++++++
|
||||
oci/layer/tar_extract_test.go | 5 +++++
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index d0938633329d..3b223135bed5 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -82,7 +82,7 @@ umociimage:
|
||||
.PHONY: test-unit
|
||||
test-unit: umociimage
|
||||
docker run --rm -it -v $(PWD):/go/src/$(PROJECT) --cap-add=SYS_ADMIN $(UMOCI_IMAGE) make local-test-unit
|
||||
- docker run --rm -it -v $(PWD):/go/src/$(PROJECT) -u 1000:1000 --cap-drop=all $(UMOCI_IMAGE) go test -v $(PROJECT)/pkg/unpriv
|
||||
+ docker run --rm -it -v $(PWD):/go/src/$(PROJECT) -u 1000:1000 --cap-drop=all $(UMOCI_IMAGE) make local-test-unit
|
||||
|
||||
.PHONY: local-test-unit
|
||||
local-test-unit: umoci
|
||||
diff --git a/oci/cas/dir_test.go b/oci/cas/dir_test.go
|
||||
index 14eaf1799648..efddb14d23b6 100644
|
||||
--- a/oci/cas/dir_test.go
|
||||
+++ b/oci/cas/dir_test.go
|
||||
@@ -40,6 +40,11 @@ import (
|
||||
|
||||
// readonly makes the given path read-only (by bind-mounting it as "ro").
|
||||
func readonly(t *testing.T, path string) {
|
||||
+ if os.Geteuid() != 0 {
|
||||
+ t.Log("readonly tests only work with root privileges")
|
||||
+ t.Skip()
|
||||
+ }
|
||||
+
|
||||
t.Logf("mounting %s as readonly", path)
|
||||
|
||||
if err := syscall.Mount(path, path, "", syscall.MS_BIND|syscall.MS_RDONLY, ""); err != nil {
|
||||
@@ -52,6 +57,11 @@ func readonly(t *testing.T, path string) {
|
||||
|
||||
// readwrite undoes the effect of readonly.
|
||||
func readwrite(t *testing.T, path string) {
|
||||
+ if os.Geteuid() != 0 {
|
||||
+ t.Log("readonly tests only work with root privileges")
|
||||
+ t.Skip()
|
||||
+ }
|
||||
+
|
||||
if err := syscall.Unmount(path, syscall.MNT_DETACH); err != nil {
|
||||
t.Fatalf("unmount %s: %s", path, err)
|
||||
}
|
||||
diff --git a/oci/layer/tar_extract_test.go b/oci/layer/tar_extract_test.go
|
||||
index a2af3ddade8b..81311b00e891 100644
|
||||
--- a/oci/layer/tar_extract_test.go
|
||||
+++ b/oci/layer/tar_extract_test.go
|
||||
@@ -463,6 +463,11 @@ func TestUnpackHardlink(t *testing.T) {
|
||||
|
||||
// TestUnpackEntryMap checks that the mapOptions handling works.
|
||||
func TestUnpackEntryMap(t *testing.T) {
|
||||
+ if os.Geteuid() != 0 {
|
||||
+ t.Log("mapOptions tests only work with root privileges")
|
||||
+ t.Skip()
|
||||
+ }
|
||||
+
|
||||
// TODO: Modify this to use subtests once Go 1.7 is in enough places.
|
||||
func(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
--
|
||||
2.11.0
|
||||
|
3
umoci-0.0.0.tar.xz
Normal file
3
umoci-0.0.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8fbae238da0688aab427b97217befe7e8aa7f71ea7f46978eba7beb579459de6
|
||||
size 151876
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f96118ab3b011860868b890f217b35cef09d2cff0a9df7f0c2fa9685a6867739
|
||||
size 151368
|
@ -1,3 +1,41 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 6 17:06:05 UTC 2017 - asarai@suse.com
|
||||
|
||||
- Switch upstream channel to openSUSE's GitHub (where the project has been
|
||||
moved).
|
||||
- Update to umoci v0.0.0. Upstream changelog:
|
||||
This is the first beta release of umoci, and it includes very few
|
||||
changes from v0.0.0-rc3. However, at this point the UX is effectively
|
||||
stable and umoci is properly tested. The (small) list of changes in this
|
||||
release from -rc3 is:
|
||||
|
||||
* Static compilation now works properly. openSUSE/umoci#64
|
||||
|
||||
* 32-bit builds have been fixed, and now umoci works on 32-bit
|
||||
architectures. openSUSE/umoci#70
|
||||
|
||||
* The unit tests can now be run inside the %check section of an rpmbuild
|
||||
script, allowing for proper testing of packages when they are built on
|
||||
openSUSE (and Fedora). openSUSE/umoci#65
|
||||
|
||||
* Unit tests have been massively expanded, as have the integration
|
||||
tests. In addition, full coverage profiles (both unit and integration)
|
||||
are generated to fully understand how much of the code is properly
|
||||
tested. Currently it is at ~80%. openSUSE/umoci#68 openSUSE/umoci#69
|
||||
|
||||
* The logging output has been cleaned up to be much better for end-users
|
||||
to read. It's also a lot less chatty now. openSUSE/umoci#73
|
||||
|
||||
* This project has now been moved to become an openSUSE project.
|
||||
openSUSE/umoci#75
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 30 14:56:38 UTC 2016 - asarai@suse.com
|
||||
|
||||
- Remove patch already merged upstream.
|
||||
- make-local-unit-tests-work-as-non-root.patch
|
||||
- Switch to running hack/test-unit.sh in %check.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 20 08:10:00 UTC 2016 - asarai@suse.com
|
||||
|
||||
|
15
umoci.spec
15
umoci.spec
@ -23,18 +23,16 @@
|
||||
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
||||
|
||||
# Project name when using go tooling.
|
||||
%define project github.com/cyphar/umoci
|
||||
%define project github.com/openSUSE/umoci
|
||||
|
||||
Name: umoci
|
||||
Version: 0.0.0~rc3
|
||||
Version: 0.0.0
|
||||
Release: 0
|
||||
Summary: Open Container Image manipulation tool
|
||||
License: Apache-2.0
|
||||
Group: System/Management
|
||||
Url: https://github.com/cyphar/umoci
|
||||
Url: https://github.com/openSUSE/umoci
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
# PATCH-FIX-UPSTREAM: Backport of cyphar/umoci#65, which is already upstream.
|
||||
Patch100: make-local-unit-tests-work-as-non-root.patch
|
||||
%ifarch %{go_arches}
|
||||
BuildRequires: go >= 1.6
|
||||
BuildRequires: go-go-md2man
|
||||
@ -58,8 +56,6 @@ the Open Container Initiative community.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
# cyphar/umoci#65
|
||||
%patch100 -p1
|
||||
|
||||
%build
|
||||
|
||||
@ -72,7 +68,7 @@ cp -avr * $HOME/go/src/%{project}
|
||||
|
||||
export VERSION="$(cat ./VERSION)"
|
||||
if [ "$VERSION" != "%{version}" ]; then
|
||||
VERSION+="-%{version}"
|
||||
VERSION="%{version}_suse"
|
||||
fi
|
||||
|
||||
# Build the binary.
|
||||
@ -87,7 +83,6 @@ make doc
|
||||
# Install the binary.
|
||||
%{__install} -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
|
||||
|
||||
|
||||
# Install all of the docs.
|
||||
%ifarch %{go_arches}
|
||||
for file in man/*.1; do
|
||||
@ -99,7 +94,7 @@ done
|
||||
|
||||
%check
|
||||
export GOPATH=$HOME/go
|
||||
go test -cover %{project}/...
|
||||
hack/test-unit.sh
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
|
Loading…
x
Reference in New Issue
Block a user