List for cgit developers and users
 help / color / Atom feed
* [PATCH 1/1] tests: skip tests if strace is not functional
@ 2019-12-11  9:57 list
  2019-12-11  9:59 ` Jason
  0 siblings, 1 reply; 6+ messages in thread
From: list @ 2019-12-11  9:57 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Chances are that strace is available but not functional due to
restricted permissions:

strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Operation not permitted
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
+++ exited with 1 +++

Just skip the tests then.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 tests/t0109-gitconfig.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/t0109-gitconfig.sh b/tests/t0109-gitconfig.sh
index 3ba6684..6ae7305 100755
--- a/tests/t0109-gitconfig.sh
+++ b/tests/t0109-gitconfig.sh
@@ -9,6 +9,12 @@ test -n "$(which strace 2>/dev/null)" || {
 	exit
 }
 
+test -n "$(strace true 2>/dev/null)" || {
+	skip_all='Skipping access validation tests: strace not functional'
+	test_done
+	exit
+}
+
 test_no_home_access () {
 	non_existent_path="/path/to/some/place/that/does/not/possibly/exist"
 	while test -d "$non_existent_path"; do


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] tests: skip tests if strace is not functional
  2019-12-11  9:57 [PATCH 1/1] tests: skip tests if strace is not functional list
@ 2019-12-11  9:59 ` Jason
  2019-12-11 10:00   ` Jason
  2019-12-11 10:01   ` list
  0 siblings, 2 replies; 6+ messages in thread
From: Jason @ 2019-12-11  9:59 UTC (permalink / raw)


That's a good idea. Thanks. Queue it up.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] tests: skip tests if strace is not functional
  2019-12-11  9:59 ` Jason
@ 2019-12-11 10:00   ` Jason
  2019-12-11 10:05     ` list
  2019-12-11 10:01   ` list
  1 sibling, 1 reply; 6+ messages in thread
From: Jason @ 2019-12-11 10:00 UTC (permalink / raw)


On Wed, Dec 11, 2019 at 10:59 AM Jason A. Donenfeld <Jason at zx2c4.com> wrote:
>
> That's a good idea. Thanks. Queue it up.

Actually, wait.

Wouldn't it be better to do this as:

`strace true >/dev/null 2>&1 || { skip_all....`


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] tests: skip tests if strace is not functional
  2019-12-11  9:59 ` Jason
  2019-12-11 10:00   ` Jason
@ 2019-12-11 10:01   ` list
  1 sibling, 0 replies; 6+ messages in thread
From: list @ 2019-12-11 10:01 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Wed, 2019/12/11 10:59:
> That's a good idea. Thanks. Queue it up.

Done.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20191211/46f741d2/attachment.asc>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] tests: skip tests if strace is not functional
  2019-12-11 10:00   ` Jason
@ 2019-12-11 10:05     ` list
  2019-12-11 10:06       ` Jason
  0 siblings, 1 reply; 6+ messages in thread
From: list @ 2019-12-11 10:05 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Wed, 2019/12/11 11:00:
> On Wed, Dec 11, 2019 at 10:59 AM Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> >
> > That's a good idea. Thanks. Queue it up.  
> 
> Actually, wait.
> 
> Wouldn't it be better to do this as:
> 
> `strace true >/dev/null 2>&1 || { skip_all....`

Right... I should have tested both cases. :-p

Forced pushed with updated patch.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20191211/55fb045e/attachment-0001.asc>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] tests: skip tests if strace is not functional
  2019-12-11 10:05     ` list
@ 2019-12-11 10:06       ` Jason
  0 siblings, 0 replies; 6+ messages in thread
From: Jason @ 2019-12-11 10:06 UTC (permalink / raw)


Patch looks good. Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11  9:57 [PATCH 1/1] tests: skip tests if strace is not functional list
2019-12-11  9:59 ` Jason
2019-12-11 10:00   ` Jason
2019-12-11 10:05     ` list
2019-12-11 10:06       ` Jason
2019-12-11 10:01   ` list

List for cgit developers and users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/cgit

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.cgit


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git