<commit_before>#!/usr/local/bin/tcsh -f
#################################################################
#								#
# Copyright (c) 2002-2016 Fidelity National Information		#
# Services, Inc. and/or its subsidiaries. All rights reserved.	#
#								#
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries.	#
# All rights reserved.						#
#								#
#	This source code contains the intellectual property	#
#	of its copyright holder(s), and is made available	#
#	under a license.  If you do not know the terms of	#
#	the license, please stop and do not read further.	#
#								#
#################################################################
# Called for multi-machine tests only
#
# if running in UTF-8 locale, punctuation marks get displayed as their octal equivalents due to some tcsh bug
# to work around this until tcsh is fixed, we transform such an output to what it should normally be.
# gtm_icu_version is host specific (depending on the ICU version installed). It is dynamically obtained at shell startup.
# So remove it from the environment variable sending list
if ($HOSTOS == "SunOS") then
	setenv | $grep -E "^gtm|^acc_meth|^tst|^test|^PRI|^SEC|^remote_ver|^remote_image|^user|^mailing_list" | $grep -vE "gtm_icu_version" |  sed 's/\\\075/=/g' >&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	# Fix user specific environment variables
	setenv | $grep -E "gtm_linktmpdir" | sed 's/\\\075/=/g' | sed 's/'$user'/$user/' >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt

else
	setenv | $grep -E "^ydb|^gtm|^acc_meth|^tst|^test|^PRI|^SEC|^remote_ver|^remote_image|^user|^mailing_list" | $grep -vE "gtm_icu_version" >&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	setenv | $grep -E "gtm_linktmpdir" | sed 's/'$user'/$user/' >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	# Fix user specific environment variables
endif
if ($?test_replic) then
# Send encryption related environment for remote host from current host to remote host we need this for multisite tests

	if ( -e $tst_dir/$gtm_tst_out/$testname/$tst_now_secondary"_encrypt_env_settings.txt" ) cat $tst_dir/$gtm_tst_out/$testname/$tst_now_secondary"_encrypt_env_settings.txt" >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt

	if ("MULTISITE" != "$test_replic") then
		$rcp ${TMP_FILE_PREFIX}_env_${USER}.txt "$tst_remote_host":$SEC_DIR/env.txt
		if ($?gtm_test_replay) then
			$rcp $gtm_test_replay "$tst_remote_host":$SEC_DIR
		endif
	else
		#send it to all the remote hosts listed in msr_instance_config.txt
		$tst_awk '	/^HOST.*NAME:/ {hostinfo_name[$1]=$3}				\
				/^INST.*HOST:/ {instinfo_host[$1]=$3}				\
				/^INST.*INSTNAME:/ {instinfo_instname[$1]=$3}			\
				/^INST.*DBDIR:/ {instinfo_dbdir[$1]=$3}				\
			    END { for (i in instinfo_dbdir)					\
				  {	hname = hostinfo_name[instinfo_host[i]];                \
					if ("'$INSTXNAME'" == instinfo_instname[i])		\
					print "$rcp ${TMP_FILE_PREFIX}_env_${USER}.txt "hname ":" instinfo_dbdir[i]"/env.txt";	\
				  }								\
				}' msr_instance_config.txt > env_rcpfile_$$.txt

		source env_rcpfile_$$.txt
	endif
else if ("GT.CM" == $test_gtm_gtcm) then<commit_msg>[#59] Send all gt_* env vars across to remote side of multi-host test as a multi-host imptp test (e.g. dualfail_ms_1/dual_fail_multisite) could now require gt_cc_compiler etc. to be set<commit_after>#!/usr/local/bin/tcsh -f
#################################################################
#								#
# Copyright (c) 2002-2016 Fidelity National Information		#
# Services, Inc. and/or its subsidiaries. All rights reserved.	#
#								#
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries.	#
# All rights reserved.						#
#								#
#	This source code contains the intellectual property	#
#	of its copyright holder(s), and is made available	#
#	under a license.  If you do not know the terms of	#
#	the license, please stop and do not read further.	#
#								#
#################################################################
# Called for multi-machine tests only
#
# if running in UTF-8 locale, punctuation marks get displayed as their octal equivalents due to some tcsh bug
# to work around this until tcsh is fixed, we transform such an output to what it should normally be.
# gtm_icu_version is host specific (depending on the ICU version installed). It is dynamically obtained at shell startup.
# So remove it from the environment variable sending list
if ($HOSTOS == "SunOS") then
	setenv | $grep -E "^gtm|^acc_meth|^tst|^test|^PRI|^SEC|^remote_ver|^remote_image|^user|^mailing_list" | $grep -vE "gtm_icu_version" |  sed 's/\\\075/=/g' >&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	# Fix user specific environment variables
	setenv | $grep -E "gtm_linktmpdir" | sed 's/\\\075/=/g' | sed 's/'$user'/$user/' >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt

else
	setenv | $grep -E "^ydb|^gt_|^gtm|^acc_meth|^tst|^test|^PRI|^SEC|^remote_ver|^remote_image|^user|^mailing_list" | $grep -vE "gtm_icu_version" >&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	setenv | $grep -E "gtm_linktmpdir" | sed 's/'$user'/$user/' >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt
	# Fix user specific environment variables
endif
if ($?test_replic) then
# Send encryption related environment for remote host from current host to remote host we need this for multisite tests

	if ( -e $tst_dir/$gtm_tst_out/$testname/$tst_now_secondary"_encrypt_env_settings.txt" ) cat $tst_dir/$gtm_tst_out/$testname/$tst_now_secondary"_encrypt_env_settings.txt" >>&! ${TMP_FILE_PREFIX}_env_${USER}.txt

	if ("MULTISITE" != "$test_replic") then
		$rcp ${TMP_FILE_PREFIX}_env_${USER}.txt "$tst_remote_host":$SEC_DIR/env.txt
		if ($?gtm_test_replay) then
			$rcp $gtm_test_replay "$tst_remote_host":$SEC_DIR
		endif
	else
		#send it to all the remote hosts listed in msr_instance_config.txt
		$tst_awk '	/^HOST.*NAME:/ {hostinfo_name[$1]=$3}				\
				/^INST.*HOST:/ {instinfo_host[$1]=$3}				\
				/^INST.*INSTNAME:/ {instinfo_instname[$1]=$3}			\
				/^INST.*DBDIR:/ {instinfo_dbdir[$1]=$3}				\
			    END { for (i in instinfo_dbdir)					\
				  {	hname = hostinfo_name[instinfo_host[i]];                \
					if ("'$INSTXNAME'" == instinfo_instname[i])		\
					print "$rcp ${TMP_FILE_PREFIX}_env_${USER}.txt "hname ":" instinfo_dbdir[i]"/env.txt";	\
				  }								\
				}' msr_instance_config.txt > env_rcpfile_$$.txt

		source env_rcpfile_$$.txt
	endif
else if ("GT.CM" == $test_gtm_gtcm) then
{'fraction_non_alphanumeric': 0.1795400475812847, 'fraction_numerical': 0.009040444091990485, 'mean_word_length': 4.299159663865546, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4070478', 'n_tokens_mistral': 2468, 'n_tokens_neox': 2235, 'n_words': 560}