Megatest

Check-in [edcc532c16]
Login
Overview
Comment:implemented second level of env var squelching by capturing orig env in variable MT_ORIG_ENV in cfg.sh wrapper so it is inherited by nested dashboard call for test control panel.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65-testpanel-execenv
Files: files | file ages | folders
SHA1: edcc532c167c4ae2b74d6cbbe040ae356e1862f3
User & Date: bjbarcla on 2018-12-04 18:19:52
Other Links: branch diff | manifest | tags
Context
2018-12-05
13:33
added serialize-env.scm check-in: 934132ed7c user: bjbarcla tags: v1.65-testpanel-execenv
2018-12-04
18:19
implemented second level of env var squelching by capturing orig env in variable MT_ORIG_ENV in cfg.sh wrapper so it is inherited by nested dashboard call for test control panel. check-in: edcc532c16 user: bjbarcla tags: v1.65-testpanel-execenv
17:47
implemented first level of env var squelching for execute; megatest.config and runconfig.config vars remain to be squelched check-in: a647090d94 user: bjbarcla tags: v1.65-testpanel-execenv
Changes

Modified Makefile from [213d4594be] to [85eff08023].

214
215
216
217
218
219
220




221
222
223
224
225
226
227
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231







+
+
+
+







$(PREFIX)/bin/mt_laststep : utils/mt_laststep
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/mt_runstep : utils/mt_runstep
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/serialize-env: serialize-env.scm
	csc serialize-env.scm
	$(INSTALL) serialize-env $@

$(PREFIX)/bin/mt_ezstep : utils/mt_ezstep
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/mt_xterm : utils/mt_xterm
	$(INSTALL) $< $@
272
273
274
275
276
277
278

279
280
281
282
283
284
285
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290







+







$(PREFIX)/bin/.$(ARCHSTR)/dboard : dboard $(FILES) utils/mk_wrapper
	utils/mk_wrapper $(PREFIX) dboard $(PREFIX)/bin/dashboard
	chmod a+x $(PREFIX)/bin/dashboard
	$(INSTALL) dboard $(PREFIX)/bin/.$(ARCHSTR)/dboard

install : $(PREFIX)/bin/.$(ARCHSTR) $(PREFIX)/bin/.$(ARCHSTR)/mtest $(PREFIX)/bin/megatest \
          $(PREFIX)/bin/.$(ARCHSTR)/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake \
          $(PREFIX)/bin/serialize-env
	  $(PREFIX)/bin/nbfind $(PREFIX)/bin/loadrunner $(PREFIX)/bin/viewscreen $(PREFIX)/bin/mt_xterm \
	  $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun \
	  $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun $(PREFIX)/bin/mtutil \
	  $(PREFIX)/bin/tcmt $(PREFIX)/share/db/mt-pg.sql \
          $(PREFIX)/share/js/jquery-3.1.0.slim.min.js 
#         $(PREFIX)/bin/.$(ARCHSTR)/ndboard

Modified common.scm from [c3a2a3cc7d] to [7425393881].

2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090









2091
2092
2093
2094
2095
2096
2097
2079
2080
2081
2082
2083
2084
2085





2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101







-
-
-
-
-
+
+
+
+
+
+
+
+
+







      '()))


;; clear vars matching pattern, run proc, set vars back
;; if proc is a string run that string as a command with
;; system.
;;
(define *common:orig-env* (filter-map (lambda (x)
                                        (if (string-match "^MT_.*" (car x))
                                            #f
                                            x))
                                      (get-environment-variables)))
(define *common:orig-env* (if (get-environment-variable "MT_ORIG_ENV")
                              (with-input-from-string
                                  (z3:decode-buffer (base64:base64-decode (get-environment-variable "MT_ORIG_ENV")))
                                read)
                              (filter-map (lambda (x)
                                            (if (string-match "^MT_.*" (car x))
                                                #f
                                                x))
                                          (get-environment-variables))))

(define (common:with-orig-env proc)
  (let  ((current-env (get-environment-variables)))
    (for-each (lambda (x) (unsetenv (car x)))             current-env)
    (for-each (lambda (x) (setenv (car x) (cdr x))) *common:orig-env*)
    (let ((rv (cond
               ((string? proc)(system proc))

Modified utils/mk_wrapper from [a247eee08b] to [6043a9a2c6].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38







+
+
+
+







cmd=$2
target=$3
cfgfile="$prefix/bin/.$(lsb_release -sr)/cfg.sh"

if [ "$LD_LIBRARY_PATH" != "" ];then
  echo "INFO: Using LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >&2
( cat << __EOF
if [ -z \$MT_ORIG_ENV ]; then
    export MT_ORIG_ENV=\$( $prefix/bin/serialize-env )
fi

if [ "\$LD_LIBRARY_PATH" != "" ];then
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\$LD_LIBRARY_PATH
else
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
fi
__EOF
) > $cfgfile

Modified wrappers/cfg.sh from [0839bc3d5c] to [b56bcbd346].

10
11
12
13
14
15
16




17
18
19
20
21
22
23
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+
+







#     Megatest is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
# 
#     You should have received a copy of the GNU General Public License
#     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

if [ -z $MT_ORIG_ENV ]; then
    export MT_ORIG_ENV=$( PREFIX/bin/serialize-env )
fi

if [ "$LD_LIBRARY_PATH" != "" ];then
  export LD_LIBRARY_PATH=PREFIX:PREFIX/lib:PREFIX/lib64:$LD_LIBRARY_PATH
else
  export LD_LIBRARY_PATH=PREFIX:PREFIX/lib:PREFIX/lib64
fi