Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Documentation/build-configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ You may want to change it to point the build system to use some local repository

This parameter takes either a tag name or a branch name.
Tag names are usually in form of `v<number>`, where number is a systemd version.
The default is `v222`.
The default is `v229`.
You can use branch name `master` to test the bleeding edge version of systemd.

### `coreos` and `kvm` flavor
Expand All @@ -122,7 +122,7 @@ If this parameter is specified, then also `--with-coreos-local-pxe-image-systemd

The build system has no reliable way to deduce automatically what version of systemd the CoreOS PXE image contains, so it needs some help.
This parameters tells the build systemd what is the version of systemd in the local PXE image.
The value should be like tag name in systemd git repository, that is - `v<number>`, like `v222`.
The value should be like tag name in systemd git repository, that is - `v<number>`, like `v229`.
If this parameter is specified, then also `--with-coreos-local-pxe-image-path` must be specified too.

## Testing
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ AC_ARG_WITH([stage1-systemd-src],

AC_ARG_WITH([stage1-systemd-version],
[AS_HELP_STRING([--with-stage1-systemd-version],
[systemd version to build, used in 'src' stage1 flavor (default: 'v222', should be in format 'v<number>', like v222)])],
[systemd version to build, used in 'src' stage1 flavor (default: 'v229', should be in format 'v<number>', like v229)])],
[RKT_STAGE1_SYSTEMD_VER="${withval}"],
[RKT_STAGE1_SYSTEMD_VER='auto'])

Expand All @@ -112,7 +112,7 @@ AC_ARG_WITH([coreos-local-pxe-image-path],

AC_ARG_WITH([coreos-local-pxe-image-systemd-version],
[AS_HELP_STRING([--with-coreos-local-pxe-image-systemd-version],
[version of systemd in local CoreOS PXE image, used in 'coreos' and 'kvm' stage1 flavors (should be in format 'v<number>', like v222)])],
[version of systemd in local CoreOS PXE image, used in 'coreos' and 'kvm' stage1 flavors (should be in format 'v<number>', like v229)])],
[RKT_LOCAL_COREOS_PXE_IMAGE_SYSTEMD_VER="${withval}"],
[RKT_LOCAL_COREOS_PXE_IMAGE_SYSTEMD_VER=])

Expand Down Expand Up @@ -363,7 +363,7 @@ RKT_IF_HAS_FLAVOR([${RKT_STAGE1_FLAVORS}],[src],
[:])
AS_VAR_IF([RKT_STAGE1_SYSTEMD_VER], [auto],
dnl systemd version not specified, use default
[RKT_STAGE1_SYSTEMD_VER='v222'],
[RKT_STAGE1_SYSTEMD_VER='v229'],
dnl systemd version specified, use it
[:])],
dnl we are not building src flavor
Expand Down
7 changes: 5 additions & 2 deletions stage1/init/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func appToSystemd(p *stage1commontypes.Pod, ra *schema.RuntimeApp, interactive b
}

func writeShutdownService(p *stage1commontypes.Pod) error {
_, systemdVersion, err := GetFlavor(p)
flavor, systemdVersion, err := GetFlavor(p)
if err != nil {
return err
}
Expand All @@ -493,7 +493,10 @@ func writeShutdownService(p *stage1commontypes.Pod) error {
// This can happen, for example, when building rkt with:
//
// ./configure --with-stage1-flavors=src --with-stage1-systemd-version=master
if systemdVersion != 0 && systemdVersion < 227 {
//
// The patches for the "exit" verb are backported to the "coreos" flavor, so
// don't rely on the systemd version on the "coreos" flavor.
if flavor != "coreos" && systemdVersion != 0 && systemdVersion < 227 {
shutdownVerb = "halt"
}

Expand Down
4 changes: 2 additions & 2 deletions stage1/usr_from_coreos/coreos-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ _CCN_INCLUDED_ := x
$(call setup-tmp-dir,CCN_TMPDIR)

# systemd version in coreos image
CCN_SYSTEMD_VERSION := v222
CCN_SYSTEMD_VERSION := v225
# coreos image version
CCN_IMG_RELEASE := 794.1.0
CCN_IMG_RELEASE := 991.0.0
# coreos image URL
CCN_IMG_URL := http://alpha.release.core-os.net/amd64-usr/$(CCN_IMG_RELEASE)/coreos_production_pxe_image.cpio.gz
# path to downloaded pxe image
Expand Down
8 changes: 4 additions & 4 deletions stage1/usr_from_coreos/manifest.d/bash.manifest
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
bin/bash
lib64/ld-2.20.so
lib64/ld-2.21.so
lib64/ld-linux-x86-64.so.2
lib64/libc-2.20.so
lib64/libc-2.21.so
lib64/libc.so.6
lib64/libdl-2.20.so
lib64/libdl-2.21.so
lib64/libdl.so
lib64/libdl.so.2
lib64/libncurses.so
lib64/libncurses.so.5
lib64/libncurses.so.5.9
lib64/libreadline.so
lib64/libreadline.so.6
lib64/libreadline.so.6.2
lib64/libreadline.so.6.3
16 changes: 8 additions & 8 deletions stage1/usr_from_coreos/manifest.d/systemd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bin/systemd-sysusers
bin/systemd-tmpfiles
bin/systemd-tty-ask-password-agent
lib
lib64/ld-2.20.so
lib64/ld-2.21.so
lib64/ld-linux-x86-64.so.2
lib64/libattr.so
lib64/libattr.so.1
Expand All @@ -31,16 +31,16 @@ lib64/libaudit.so.1.0.0
lib64/libblkid.so
lib64/libblkid.so.1
lib64/libblkid.so.1.1.0
lib64/libc-2.20.so
lib64/libc-2.21.so
lib64/libcap.so
lib64/libcap.so.2
lib64/libcap.so.2.22
lib64/libcap.so.2.24
lib64/libc.so.6
lib64/libgcc_s.so
lib64/libgcc_s.so.1
lib64/libgcrypt.so
lib64/libgcrypt.so.11
lib64/libgcrypt.so.11.8.2
lib64/libgcrypt.so.20
lib64/libgcrypt.so.20.0.3
lib64/libgpg-error.so
lib64/libgpg-error.so.0
lib64/libgpg-error.so.0.10.0
Expand All @@ -52,7 +52,7 @@ lib64/libip4tc.so.0
lib64/libip4tc.so.0.1.0
lib64/libkmod.so
lib64/libkmod.so.2
lib64/libkmod.so.2.2.5
lib64/libkmod.so.2.2.11
lib64/liblzma.so
lib64/liblzma.so.5
lib64/liblzma.so.5.0.8
Expand All @@ -62,10 +62,10 @@ lib64/libmount.so.1.1.0
lib64/libpcre.so
lib64/libpcre.so.1
lib64/libpcre.so.1.2.4
lib64/libpthread-2.20.so
lib64/libpthread-2.21.so
lib64/libpthread.so
lib64/libpthread.so.0
lib64/librt-2.20.so
lib64/librt-2.21.so
lib64/librt.so
lib64/librt.so.1
lib64/libseccomp.so
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sudo gpasswd -a runner rkt

```
./tests/run-build.sh none
./tests/run-build.sh src v222
./tests/run-build.sh src v229
```

#### Thread 2
Expand Down
3 changes: 1 addition & 2 deletions tests/inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ func main() {

err := ioutil.WriteFile(fileName, []byte(content), 0600)
if err != nil {
// This error message is tested in TestVolumes
fmt.Fprintf(os.Stderr, "Cannot write to file %q: %v\n", fileName, err)
os.Exit(0)
os.Exit(1)
}
}

Expand Down
14 changes: 8 additions & 6 deletions tests/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ fi
if [ "${CI-}" == true ] ; then
# https://semaphoreci.com/
if [ "${SEMAPHORE-}" == true ] ; then
# A colon to guard against an empty body error.
:

# Most dependencies are already installed on Semaphore.
# Here we can install any missing dependencies. Whenever
# Semaphore installs more dependencies on their platform,
Expand All @@ -31,8 +28,13 @@ if [ "${CI-}" == true ] ; then
sudo apt-get install -y libacl1-dev

# libmount: https://github.com/systemd/systemd/pull/986#issuecomment-138451264
# sudo add-apt-repository --yes ppa:pitti/systemd-semaphore
# sudo apt-get update -qq || true
# sudo apt-get install -y libmount-dev libmount1
sudo add-apt-repository --yes ppa:pitti/systemd-semaphore
sudo apt-get update -qq || true
sudo apt-get install -y libmount-dev libmount1

# building systemd v229 crashes with the gcc 4.8, update to gcc 5
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -qq
sudo apt-get install gcc-5 gcc-5-base libgcc-5-dev -y -qq
fi
fi
2 changes: 1 addition & 1 deletion tests/rkt_api_service_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func setup() (*testutils.RktRunCtx, *gexpect.ExpectSubprocess, v1alpha.PublicAPI
ctx := testutils.NewRktRunCtx()
svc := startAPIService(t, ctx)
c, conn := newAPIClientOrFail(t, "localhost:15441")
imagePath := patchTestACI("rkt-inspect-print.aci", "--exec=/inspect --print-msg=HELLO_API --exit-code=42")
imagePath := patchTestACI("rkt-inspect-print.aci", "--exec=/inspect --print-msg=HELLO_API")

return ctx, svc, c, conn, imagePath
}
Expand Down
2 changes: 1 addition & 1 deletion tests/rkt_api_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func TestAPIServiceListInspectPods(t *testing.T) {
t.Errorf("Unexpected result: %v, should see zero pods", resp.Pods)
}

patches := []string{"--exec=/inspect --print-msg=HELLO_API --exit-code=42"}
patches := []string{"--exec=/inspect --print-msg=HELLO_API --exit-code=0"}
imageHash := patchImportAndFetchHash("rkt-inspect-print.aci", patches, t, ctx)
imgID, err := types.NewHash(imageHash)
if err != nil {
Expand Down
37 changes: 22 additions & 15 deletions tests/rkt_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,45 @@ func TestDNS(t *testing.T) {
defer ctx.Cleanup()

for _, tt := range []struct {
paramDNS string
expectedLine string
paramDNS string
expectedLine string
expectedError bool
}{
{
paramDNS: "",
expectedLine: "Cannot read file",
paramDNS: "",
expectedLine: "Cannot read file",
expectedError: true,
},
{
paramDNS: "--dns=8.8.4.4",
expectedLine: "nameserver 8.8.4.4",
paramDNS: "--dns=8.8.4.4",
expectedLine: "nameserver 8.8.4.4",
expectedError: false,
},
{
paramDNS: "--dns=8.8.8.8 --dns=8.8.4.4",
expectedLine: "nameserver 8.8.8.8",
paramDNS: "--dns=8.8.8.8 --dns=8.8.4.4",
expectedLine: "nameserver 8.8.8.8",
expectedError: false,
},
{
paramDNS: "--dns=8.8.8.8 --dns=8.8.4.4 --dns-search=search.com --dns-opt=debug",
expectedLine: "nameserver 8.8.4.4",
paramDNS: "--dns=8.8.8.8 --dns=8.8.4.4 --dns-search=search.com --dns-opt=debug",
expectedLine: "nameserver 8.8.4.4",
expectedError: false,
},
{
paramDNS: "--dns-search=foo.com --dns-search=bar.com",
expectedLine: "search foo.com bar.com",
paramDNS: "--dns-search=foo.com --dns-search=bar.com",
expectedLine: "search foo.com bar.com",
expectedError: false,
},
{
paramDNS: "--dns-opt=debug --dns-opt=use-vc --dns-opt=rotate",
expectedLine: "options debug use-vc rotate",
paramDNS: "--dns-opt=debug --dns-opt=use-vc --dns-opt=rotate",
expectedLine: "options debug use-vc rotate",
expectedError: false,
},
} {

rktCmd := fmt.Sprintf(`%s --insecure-options=image run --set-env=FILE=/etc/resolv.conf %s %s`,
ctx.Cmd(), tt.paramDNS, imageFile)
t.Logf("%s\n", rktCmd)
runRktAndCheckOutput(t, rktCmd, tt.expectedLine, false)
runRktAndCheckOutput(t, rktCmd, tt.expectedLine, tt.expectedError)
}
}
8 changes: 3 additions & 5 deletions tests/rkt_exit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestExitCodeSimple(t *testing.T) {
cmd := fmt.Sprintf(`%s --debug --insecure-options=image run --mds-register=false %s`,
ctx.Cmd(), imageFile)
t.Logf("%s\n", cmd)
spawnAndWaitOrFail(t, cmd, 0)
spawnAndWaitOrFail(t, cmd, i)
checkAppStatus(t, ctx, false, "rkt-inspect", fmt.Sprintf("status=%d", i))
}
}
Expand Down Expand Up @@ -71,10 +71,8 @@ func TestExitCodeWithSeveralApps(t *testing.T) {
}

t.Logf("Waiting pod termination\n")
// Currently we have systemd v222 in the coreos flavor which doesn't
// include the exit status propagation code.
// TODO(iaguis): we should expect 5 as the exit status when we update to v229
waitOrFail(t, child, 0)
// Since systemd v227, the exit status is propagated from the app to rkt
waitOrFail(t, child, 5)

t.Logf("Check final status\n")

Expand Down
2 changes: 1 addition & 1 deletion tests/rkt_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func getCreationStartTime(t *testing.T, ctx *testutils.RktRunCtx, imageID string
func TestRktListCreatedStarted(t *testing.T) {
const imgName = "rkt-list-creation-start-time-test"

image := patchTestACI(fmt.Sprintf("%s.aci", imgName), fmt.Sprintf("--exec=/inspect "))
image := patchTestACI(fmt.Sprintf("%s.aci", imgName), fmt.Sprintf("--exec=/inspect --exit-code=0"))
defer os.Remove(image)

imageHash := getHashOrPanic(image)
Expand Down
15 changes: 7 additions & 8 deletions tests/rkt_non_root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,18 @@ func TestNonRootReadInfo(t *testing.T) {

// Launch some pods, this creates the environment for later testing.
imgs := []struct {
name string
msg string
exitCode string
imgFile string
name string
msg string
imgFile string
}{
{name: "inspect-1", msg: "foo-1", exitCode: "1"},
{name: "inspect-2", msg: "foo-2", exitCode: "2"},
{name: "inspect-3", msg: "foo-3", exitCode: "3"},
{name: "inspect-1", msg: "foo-1"},
{name: "inspect-2", msg: "foo-2"},
{name: "inspect-3", msg: "foo-3"},
}

for i, img := range imgs {
imgName := fmt.Sprintf("rkt-%s.aci", img.name)
imgs[i].imgFile = patchTestACI(imgName, fmt.Sprintf("--name=%s", img.name), fmt.Sprintf("--exec=/inspect --print-msg=%s --exit-code=%s", img.msg, img.exitCode))
imgs[i].imgFile = patchTestACI(imgName, fmt.Sprintf("--name=%s", img.name), fmt.Sprintf("--exec=/inspect --print-msg=%s --exit-code=0", img.msg))
defer os.Remove(imgs[i].imgFile)
}

Expand Down
Loading