Megatest

Check-in [03755c29bf]
Login
Overview
Comment:Improved syscheck
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65-newview
Files: files | file ages | folders
SHA1: 03755c29bfeaf4f4b6d00c21048eb5dd798e5cba
User & Date: matt on 2020-04-09 22:44:48
Other Links: branch diff | manifest | tags
Context
2020-04-10
00:06
Added check of disks section check-in: 2c22506f66 user: matt tags: v1.65-newview
2020-04-09
22:44
Improved syscheck check-in: 03755c29bf user: matt tags: v1.65-newview
16:03
Added -syscheck, mostly working check-in: 55a9a872ee user: mrwellan tags: v1.65-newview
Changes

Modified mutils/mutils.scm from [06aac990f8] to [88ee953daf].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    *

  (import chicken scheme
	  ;; data-structures posix
	  srfi-1
	  ;; srfi-13
	  srfi-69
	  ;; ports
	  extras
	  regex
	  posix
	  data-structures
	  )

(define (mutils:hierhash-ref hh . keys)







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    *

  (import chicken scheme
	  ;; data-structures posix
	  srfi-1
	  ;; srfi-13
	  srfi-69
	  ports
	  extras
	  regex
	  posix
	  data-structures
	  )

(define (mutils:hierhash-ref hh . keys)
199
200
201
202
203
204
205
206
207







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
	  (begin
	    (with-output-to-file fname
	      (lambda ()
		(print "You can delete this file")))
	    (delete-file fname)
	    #t)))))

;; (define (confirm-ssh-access-to-host hostname)
  








;; do some sanity checks on the system
;;
(define (mutils:syscheck proc)
  ;; current dir writeable and do megatest.config, runconfigs.config files exist/readable
  (print "Current directory " (current-directory) " writeable: " 
	 (if (check-write-create ".") "yes" "NO"))
  ;; home dir writeable
  (print "Home directory " (get-environment-variable "HOME") " writeable: "
	 (if (check-write-create (get-environment-variable "HOME")) "yes" "NO"))
  ;; /tmp writeable
  (print "/tmp directory writeable: " (if (check-write-create "/tmp") "yes" "NO"))
  ;; load configs
  (print "$DISPLAY set: " (if (get-environment-variable "DISPLAY")
			      (conc  (get-environment-variable "DISPLAY") " yes")
			      "NO"))

  (print "$DISPLAY accessible? "
	 (if (eq? (system "xdpyinfo -display $DISPLAY &>/dev/null;") 0)

	     "yes" "NO"))


  ;;    check load on homehost
  ;;    each run disk read/write
  ;;    link tree writeable
  )
  
)







|
|
>
>
>
>
>
>
>

|
















|
>









199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
	  (begin
	    (with-output-to-file fname
	      (lambda ()
		(print "You can delete this file")))
	    (delete-file fname)
	    #t)))))

;; (define (confirm-ssh-access-to-host hostname

(define (check-display dsp)
  (let-values (((inp oup pid)
		(process "xdpyinfo" `("-display" ,dsp))))
    (let ((res (with-input-from-port inp read-lines)))
      (let-values (((pidres status estatus)
		    (process-wait pid)))
	(and status (eq? estatus 0))))))

		       ;; do some sanity checks on the system
;;
(define (mutils:syscheck proc)
  ;; current dir writeable and do megatest.config, runconfigs.config files exist/readable
  (print "Current directory " (current-directory) " writeable: " 
	 (if (check-write-create ".") "yes" "NO"))
  ;; home dir writeable
  (print "Home directory " (get-environment-variable "HOME") " writeable: "
	 (if (check-write-create (get-environment-variable "HOME")) "yes" "NO"))
  ;; /tmp writeable
  (print "/tmp directory writeable: " (if (check-write-create "/tmp") "yes" "NO"))
  ;; load configs
  (print "$DISPLAY set: " (if (get-environment-variable "DISPLAY")
			      (conc  (get-environment-variable "DISPLAY") " yes")
			      "NO"))

  (print "$DISPLAY accessible? "
	  ;; (eq? (system "xdpyinfo -display $DISPLAY &>/dev/null") 0)
	 (if (check-display (get-environment-variable "DISPLAY"))
	     "yes" "NO"))


  ;;    check load on homehost
  ;;    each run disk read/write
  ;;    link tree writeable
  )
  
)