[107517] branches/gsoc13-tests/tests/test/trace
cal at macports.org
cal at macports.org
Mon Jul 1 17:26:56 PDT 2013
Revision: 107517
https://trac.macports.org/changeset/107517
Author: cal at macports.org
Date: 2013-07-01 17:26:56 -0700 (Mon, 01 Jul 2013)
Log Message:
-----------
GSoC testing branch: revert accidential commits r107513-107514
Revision Links:
--------------
https://trac.macports.org/changeset/107513
Modified Paths:
--------------
branches/gsoc13-tests/tests/test/trace/Makefile
branches/gsoc13-tests/tests/test/trace/Portfile
branches/gsoc13-tests/tests/test/trace/master
Modified: branches/gsoc13-tests/tests/test/trace/Makefile
===================================================================
--- branches/gsoc13-tests/tests/test/trace/Makefile 2013-07-02 00:22:41 UTC (rev 107516)
+++ branches/gsoc13-tests/tests/test/trace/Makefile 2013-07-02 00:26:56 UTC (rev 107517)
@@ -2,28 +2,33 @@
.PHONY: test
-PWD=$(shell dirname `pwd`)
-
$(bindir)/port:
@echo "Please install MacPorts before running this test"
@exit 1
test:
@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
- @rm -fr ../tracetesttmp
- @mkdir -p ../tracetesttmp
- @chown $(RUNUSR) ../tracetesttmp
- @sudo -u $(RUNUSR) touch ../tracetesttmp/delete-trace
- @sudo -u $(RUNUSR) touch ../tracetesttmp/rename-trace
- @sudo -u $(RUNUSR) mkdir -p ../tracetesttmp/rmdir-trace
+ @touch delete-trace
+ @touch rename-trace
+ @mkdir -p rmdir-trace
+ @rm -f create-trace
+ @rm -f create-trace-modenv
+ @rm -rf mkdir-trace
@rm -f /tmp/hello-trace
- @ln -sf /usr/include/unistd.h /tmp/link-trace2
- @chown -h $(RUNUSR) /tmp/link-trace2
+ @rm -f link-trace
+ @ln -s /usr/include/unistd.h /tmp/link-trace2
@PORTSRC=$(PORTSRC) $(bindir)/port -t test > output 2>&1 || (cat output; exit 1)
+ @rm -f link-trace
@rm -f /tmp/link-trace2
+ @rm -f delete-trace
+ @rm -f rename-trace
+ @rm -f rename-new-trace
+ @rm -f create-trace
+ @rm -f create-trace-modenv
+ @rm -rf mkdir-trace
+ @rm -rf rmdir-trace
@rm -f /tmp/hello-trace
- @rm -rf ../tracetesttmp
- @sed -e "s|$(PWD)|PWD|g" < output > output.sed
+ @sed -e "s|${PWD}|PWD|g" < output > output.sed
@diff -u master output.sed 2>&1 | tee difference
@if [ -s difference ]; then \
exit 1; \
Modified: branches/gsoc13-tests/tests/test/trace/Portfile
===================================================================
--- branches/gsoc13-tests/tests/test/trace/Portfile 2013-07-02 00:22:41 UTC (rev 107516)
+++ branches/gsoc13-tests/tests/test/trace/Portfile 2013-07-02 00:26:56 UTC (rev 107517)
@@ -1,50 +1,33 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
-PortSystem 1.0
-name trace
-version 1
-categories test
-maintainers pguyot at kallisys.net
-description Test port for -t
-homepage http://www.macports.org/
-platforms darwin
+PortSystem 1.0
+name trace
+version 1
+categories test
+maintainers pguyot at kallisys.net
+description Test port for -t
+homepage http://www.macports.org/
+platforms darwin
-long_description ${description}
+long_description ${description}
distfiles
-use_configure no
-build {}
-destroot {
- system "touch ${destroot}${prefix}/lib/${name}"
+use_configure no
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
}
test {
- proc fails {operation} {
- if {![catch $operation]} {
- ui_error "Operation ${operation} succeeded although it should have failed!"
- error "test failure"
- }
- }
- # the port directory is outside of the sandbox; make sure files can't be
- # created, deleted or symlinked into place here
- fails {system "touch ../tracetesttmp/create-trace"}
- fails {system "rm ../tracetesttmp/delete-trace"}
- fails {system "ln -s /usr/include/ ../tracetesttmp/link-trace"}
- # we also don't want mkdir or rmdir here
- fails {system "mkdir ../tracetesttmp/mkdir-trace"}
- fails {system "rmdir ../tracetesttmp/rmdir-trace"}
- # renaming should also be prohibited
- fails {system "mv ../tracetesttmp/rename-trace ../tracetesttmp/rename-new-trace"}
-
- # test access to /tmp
- system "touch /tmp/hello-trace"
- system "rm /tmp/hello-trace"
- system "rm /tmp/link-trace2"
-
- # overwriting DYLD_INSERT_LIBRARIES should not allow escaping the sandbox (due to env restoring)
- fails {system "DYLD_INSERT_LIBRARIES= touch ../tracetesttmp/create-trace-modenv"}
-
- # if the directories already exist, mkdir -p should succeed.
- system "mkdir -p /usr/bin"
+ catch {system "touch create-trace"}
+ catch {system "rm delete-trace"}
+ system "touch /tmp/hello-trace"
+ system "rm /tmp/hello-trace"
+ system "ln -s /usr/include/ link-trace"
+ system "rm /tmp/link-trace2"
+ catch {system "mkdir mkdir-trace"}
+ catch {system "rmdir rmdir-trace"}
+ catch {system "mv rename-trace rename-new-trace"}
+ catch {system "DYLD_INSERT_LIBRARIES= touch create-trace-modenv"}
+ system "mkdir -p /usr/bin"
}
Modified: branches/gsoc13-tests/tests/test/trace/master
===================================================================
--- branches/gsoc13-tests/tests/test/trace/master 2013-07-02 00:22:41 UTC (rev 107516)
+++ branches/gsoc13-tests/tests/test/trace/master 2013-07-02 00:26:56 UTC (rev 107517)
@@ -4,9 +4,9 @@
---> Configuring trace
---> Building trace
---> Testing trace
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/create-trace
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/create-trace-modenv
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/delete-trace
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/mkdir-trace
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/rename-trace
-Warning: An activity was attempted outside sandbox: PWD/tracetesttmp/rmdir-trace
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/create-trace
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/create-trace-modenv
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/delete-trace
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/mkdir-trace
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/rename-trace
+Warning: A creation/deletion/modification was attempted outside sandbox: PWD/rmdir-trace
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130701/8dc5d88b/attachment.html>
More information about the macports-changes
mailing list