aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connection.lisp16
-rw-r--r--src/deployment.lisp17
-rw-r--r--src/package.lisp3
3 files changed, 18 insertions, 18 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index 0ebe348..487559d 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -436,22 +436,6 @@ PATH may be any kind of file, including directories."
(mrun :may-fail #?"chown ${uid}:${gid} ${namestring}")))))
(connection-writefile *connection* namestring content mode)))
-(defmacro with-local-connection (&body forms)
- "Execute FORMS as though a :LOCAL connection had been established.
-This is for testing purposes at the REPL and in Consfigurator's test suite.
-FORMS is typically the programmatic application of one or more properties."
- `(let ((*host* (make-host :propspec (make-propspec :systems nil)))
- (*connection* (establish-connection :local nil)))
- ,@forms))
-
-(defmacro with-local-passwordless-sudo-connection (&body forms)
- "Execute FORMS as though a passwordless :SUDO connection to localhost had been
-established. Occasionally useful for testing purposes at the REPL."
- `(with-local-connection
- (let ((*connection* (establish-connection :sudo nil
- :user "root" :password nil)))
- ,@forms)))
-
;;;; Connection attributes
diff --git a/src/deployment.lisp b/src/deployment.lisp
index 104a810..0703c37 100644
--- a/src/deployment.lisp
+++ b/src/deployment.lisp
@@ -271,3 +271,20 @@ different user."
(pushnew system (slot-value (host-propspec *host*) 'systems)))
(dolist (attr (getf (hostattrs host) :data))
(push-hostattrs :data attr)))
+
+(defprop evals :posix (&rest forms)
+ "Property which just evaluates each of FORMS using EVAL. Only for testing
+newly defined functions and programmatic applications of properties at the
+REPL with DEPLOY-THESE/HOSTDEPLOY-THESE -- do not add to hosts.
+
+For example, to sudo to root to test your new function which needs root
+privileges to do anything at all,
+
+ (deploy-these :sudo melete.silentflame.com (evals '(my-new-function)))
+
+where melete.silentflame.com is your laptop.
+
+Note that while this property is declared to be :POSIX for flexibility,
+whether it is actually :POSIX depends on what input and output FORMS perform."
+ (:desc (format nil "Evaluated ~{~S~^ ~}" forms))
+ (:apply (eval `(progn ,@forms))))
diff --git a/src/package.lisp b/src/package.lisp
index 5dd7420..9d69cf3 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -112,8 +112,6 @@
#:delete-remote-trees
#:readfile
#:writefile
- #:with-local-connection
- #:with-local-passwordless-sudo-connection
#:propagate-connattr
#:get-connattr
@@ -200,6 +198,7 @@
#:hostdeploy-these
#:hostdeploy-these*
#:continue-deploy*
+ #:evals
;; data.lisp
#:data