tests: make sure patches can create executables
Create a 755 file in a git and an hg repo, using a patch. Later make sure the permissions are as expected. Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
81c5beedaa
commit
acc60f4f3a
@ -21,6 +21,7 @@
|
|||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import stat
|
||||||
import shutil
|
import shutil
|
||||||
from kas import kas
|
from kas import kas
|
||||||
|
|
||||||
@ -33,3 +34,5 @@ def test_patch(tmpdir):
|
|||||||
shutil.copytree('tests/test_patch', tdir)
|
shutil.copytree('tests/test_patch', tdir)
|
||||||
os.chdir(tdir)
|
os.chdir(tdir)
|
||||||
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
kas.kas(['shell', 'test.yml', '-c', 'true'])
|
||||||
|
for f in ['kas/tests/test_patch/hello.sh', 'hello/hello.sh']:
|
||||||
|
assert os.stat(f)[stat.ST_MODE] & stat.S_IXUSR
|
||||||
|
15
tests/test_patch/patches/hello/quilt/003.patch
Normal file
15
tests/test_patch/patches/hello/quilt/003.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# HG changeset patch
|
||||||
|
# User kas <kas@example.com>
|
||||||
|
# Date 1568977454 -7200
|
||||||
|
# Fri Sep 20 13:04:14 2019 +0200
|
||||||
|
# Node ID b8fc0927f880cc0ef6b79ba6ee470f7504d68466
|
||||||
|
# Parent 66ff34c19e817cf518ebbd53bef4a992d669e68e
|
||||||
|
msg
|
||||||
|
|
||||||
|
diff --git a/hello.sh b/hello.sh
|
||||||
|
new file mode 100755
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/hello.sh
|
||||||
|
@@ -0,0 +1,2 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+echo Hello World!
|
@ -2,3 +2,4 @@
|
|||||||
# this is a revert of the other 001 we applied without quilt
|
# this is a revert of the other 001 we applied without quilt
|
||||||
001.patch # first patch
|
001.patch # first patch
|
||||||
002.patch
|
002.patch
|
||||||
|
003.patch # introduce an executable
|
||||||
|
21
tests/test_patch/patches/kas/quilt/003.patch
Normal file
21
tests/test_patch/patches/kas/quilt/003.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
From b401ea2143d6e214a74f100c1d86b57ee3aaed26 Mon Sep 17 00:00:00 2001
|
||||||
|
From: kas <kas@example.com>
|
||||||
|
Date: Fri, 20 Sep 2019 10:33:07 +0200
|
||||||
|
Subject: [PATCH] test
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/test_patch/hello.sh | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
create mode 100755 tests/test_patch/hello.sh
|
||||||
|
|
||||||
|
diff --git a/tests/test_patch/hello.sh b/tests/test_patch/hello.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..c100654
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/test_patch/hello.sh
|
||||||
|
@@ -0,0 +1,2 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+echo Hello World!
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
@ -2,3 +2,4 @@
|
|||||||
# this is a revert of the other 001 we applied without quilt
|
# this is a revert of the other 001 we applied without quilt
|
||||||
001.patch # first patch
|
001.patch # first patch
|
||||||
002.patch
|
002.patch
|
||||||
|
003.patch # introduce an executable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user