<commit_before># Copyright (c) 2013, Daynix Computing LTD (www.daynix.com)
# All rights reserved.
#
# Maintained by <EMAIL>
#
# This file is a part of Bricklets library, see "Bricklets" page
# on www.daynix.com for more.
#
# This code is licensed under standard 3-clause BSD license.
# See file LICENSE supplied with this package for the full license text.

#Settings file for HCK setup

#Setup ID
if [ -z "$UNIQUE_ID" ]
then
   UNIQUE_ID=11
fi

#HCK root
HCK_ROOT=`dirname $0`

#QEMU PATH
if [ -z "$QEMU_BIN" ]
then
   QEMU_BIN=/usr/libexec/qemu-kvm
fi

#TEST DEVICE TYPE
TEST_DEV_TYPE=network
#TEST_DEV_TYPE=bootstorage
#TEST_DEV_TYPE=storage
#TEST_DEV_TYPE=balloon
#TEST_DEV_TYPE=serial
#TEST_DEV_TYPE=usb
#TEST_DEV_TYPE=video

#VNC ports
PORT_BASE=`expr ${UNIQUE_ID} '*' 3`
STUDIO_PORT=`expr ${PORT_BASE} + 0`
CLIENT1_PORT=`expr ${PORT_BASE} + 1`
CLIENT2_PORT=`expr ${PORT_BASE} + 2`

#VIDEO
VIDEO_TYPE=VNC
#VIDEO_TYPE=SPICE

#TEST NETWORK BACKEND
TEST_NET_TYPE=bridge
#TEST_NET_TYPE=OVS

#BRIDGES
WORLD_BR_NAME=whqlbr0
CTRL_BR_NAME=ctrltestbr_${UNIQUE_ID}
TEST_BR_NAME=hcktestbr_${UNIQUE_ID}

#IMAGES
IMAGES_DIR=`dirname ${HCK_ROOT}`/images
STUDIO_IMAGE=${IMAGES_DIR}/HCK_Studio_WS2008R2_SP1.qcow2

if [ -z "${CLIENT1_IMAGE}" ]
then
    CLIENT1_IMAGE=${IMAGES_DIR}/HCK_Client1_WS2008R2_SP1.qcow2
elif [ ! -f ${CLIENT1_IMAGE} ]
then
    CLIENT1_IMAGE=${IMAGES_DIR}/${CLIENT1_IMAGE}
fi

if [ -z "${CLIENT2_IMAGE}" ]
then
    CLIENT2_IMAGE=${IMAGES_DIR}/HCK_Client2_WS2008R2_SP1.qcow2
elif [ ! -f ${CLIENT2_IMAGE} ]
then
    CLIENT2_IMAGE=${IMAGES_DIR}/${CLIENT2_IMAGE}
fi


#RESOURCES
CLIENT1_CPUS=2
CLIENT2_CPUS=2
CLIENT_MEMORY=1G
WORLD_NET_DEVICE=e1000
CTRL_NET_DEVICE=e1000
FILE_TRANSFER_DEVICE=e1000

#MISC
VHOST_STATE=on
SNAPSHOT=off
UNSAFE_CACHE=off
ENABLE_S3=on
ENABLE_S4=on
ENLIGHTENMENTS_STATE=off

#Uncomment the following line and change to the appropriate value
#in order set the title postfix
#TITLE_POSTFIX=foo

#Disable samba network share
#SHARE_ON_HOST=false

#Multiqueueing - uncomment to enable virtio-net multiqueueing
#CLIENT1_N_QUEUES=8
#CLIENT2_N_QUEUES=8

#EXTRA PARAMS
#STUDIO_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"
#CLIENT1_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"
#CLIENT2_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"

#BIOS from the latest QEMU is required for power management support
#CLIENT1_EXTRA="-bios /non/existing/path/qemu/pc-bios/bios.bin"
#CLIENT2_EXTRA="-bios /non/existing/path/qemu/pc-bios/bios.bin"

#UTILITIES
test x"${SNAPSHOT}" = xon && SNAPSHOT_OPTION="-snapshot"
test x"${UNSAFE_CACHE}" = xon && DRIVE_CACHE_OPTION=",cache=unsafe"
test x"${ENLIGHTENMENTS_STATE}" = xon && ENLIGHTENMENTS_OPTION=,hv_spinlocks=0x1FFF,hv_relaxed

if [ z${ENABLE_S3} ==  zon ]
then
S3_DISABLE_OPTION="0"
else
S3_DISABLE_OPTION="1"
fi

if [ z${ENABLE_S4} ==  zon ]
then
S4_DISABLE_OPTION="0"
else
S4_DISABLE_OPTION="1"
fi

STUDIO_TELNET_PORT=$(( ${STUDIO_PORT} + 10000 ))
CLIENT1_TELNET_PORT=$(( ${CLIENT1_PORT} + 10000 ))
CLIENT2_TELNET_PORT=$(( ${CLIENT2_PORT} + 10000 ))

MONITOR_STUDIO="-monitor telnet::${STUDIO_TELNET_PORT},server,nowait -monitor vc"
MONITOR_CLIENT1="-monitor telnet::${CLIENT1_TELNET_PORT},server,nowait"
MONITOR_CLIENT2="-monitor telnet::${CLIENT2_TELNET_PORT},server,nowait"

if [ z${VIDEO_TYPE} ==  zVNC ]
then
    GRAPHICS_STUDIO="-vnc :${STUDIO_PORT}"

    GRAPHICS_CLIENT1="-vnc :${CLIENT1_PORT}"
    CLIENT1_PORTS_MSG="Vnc ${CLIENT1_PORT}/$(( ${CLIENT1_PORT} + 5900 )) Telnet ${CLIENT1_TELNET_PORT}"

    GRAPHICS_CLIENT2="-vnc :${CLIENT2_PORT}"
    CLIENT2_PORTS_MSG="Vnc ${CLIENT2_PORT}/$(( ${CLIENT2_PORT} + 5900 )) Telnet ${CLIENT2_TELNET_PORT}"

    MONITOR_STDIO="${MONITOR_STDIO} -monitor vc"
    MONITOR_CLIENT1="${MONITOR_CLIENT1} -monitor vc"
    MONITOR_CLIENT2="${MONITOR_CLIENT2} -monitor vc"
fi

if [ z${VIDEO_TYPE} ==  zSPICE ]
then
   GRAPHICS_STUDIO="-vnc :${STUDIO_PORT}"

   CLIENT1_SPICE_PORT=$(( ${CLIENT1_PORT} + 5900 ))
   CLIENT2_SPICE_PORT=$(( ${CLIENT2_PORT} + 5900 ))


   GRAPHICS_CLIENT1="-spice port=${CLIENT1_SPICE_PORT},disable-ticketing -vga qxl -global qxl-vga.revision=3"
   CLIENT1_PORTS_MSG="Spice ${CLIENT1_SPICE_PORT} Telnet ${CLIENT1_TELNET_PORT}"

   GRAPHICS_CLIENT2="-spice port=${CLIENT2_SPICE_PORT},disable-ticketing -vga qxl -global qxl-vga.revision=3"
   CLIENT2_PORTS_MSG="Spice ${CLIENT2_SPICE_PORT} Telnet ${CLIENT2_TELNET_PORT}"
fi

if [ ! -z  "${CLIENT1_N_QUEUES}" ]
then
    CLIENT1_N_VECTORS=$(( ${CLIENT1_N_QUEUES} * 2 + 2))
    CLIENT1_MQ_NETDEV_PARAM=",queues=${CLIENT1_N_QUEUES}"
    CLIENT1_MQ_DEVICE_PARAM=",mq=on,vectors=${CLIENT1_N_VECTORS}"
fi

if [ ! -z  "${CLIENT2_N_QUEUES}" ]
then
    CLIENT2_N_VECTORS=$(( ${CLIENT2_N_QUEUES} * 2 + 2))
    CLIENT2_MQ_NETDEV_PARAM=",queues=${CLIENT2_N_QUEUES}"
    CLIENT2_MQ_DEVICE_PARAM=",mq=on,vectors=${CLIENT2_N_VECTORS}"
fi

if [ ! -z "${TITLE_POSTFIX}" ]
then
    _TITLE_POSTFIX=_${TITLE_POSTFIX}
fi

#SMB share on host
if [ -z "$SHARE_ON_HOST" ] || [ "$SHARE_ON_HOST" == "default" ]
then
   SHARE_ON_HOST=`dirname ${HCK_ROOT}`/SMB_SHARE  # The default share on the host
fi

if [ -d "$SHARE_ON_HOST" ] && [ "$SHARE_ON_HOST" != "false" ]
then
   SHARE_ON_HOST=`cd ${SHARE_ON_HOST} && pwd`  # Get the absolute path
elif [ "$SHARE_ON_HOST" != "false" ]
then
   echo "Directory ${SHARE_ON_HOST} does not exist!"
   echo "Either create it, or modify the \"SHARE_ON_HOST\" environmental variable."
   echo "Running withoput a share..."
   SHARE_ON_HOST="false"
fi

remove_bridges() {
  case $TEST_NET_TYPE in
  bridge)
     ifconfig ${TEST_BR_NAME} down
     brctl delbr ${TEST_BR_NAME}
     ;;
  OVS)
     ovs-vsctl del-br ${TEST_BR_NAME}
     ;;<commit_msg>VirtHCK: Set new default SMB_SHARE location.<commit_after># Copyright (c) 2013, Daynix Computing LTD (www.daynix.com)
# All rights reserved.
#
# Maintained by <EMAIL>
#
# This file is a part of Bricklets library, see "Bricklets" page
# on www.daynix.com for more.
#
# This code is licensed under standard 3-clause BSD license.
# See file LICENSE supplied with this package for the full license text.

#Settings file for HCK setup

#Setup ID
if [ -z "$UNIQUE_ID" ]
then
   UNIQUE_ID=11
fi

#HCK root
HCK_ROOT=`dirname $0`

#QEMU PATH
if [ -z "$QEMU_BIN" ]
then
   QEMU_BIN=/usr/libexec/qemu-kvm
fi

#TEST DEVICE TYPE
TEST_DEV_TYPE=network
#TEST_DEV_TYPE=bootstorage
#TEST_DEV_TYPE=storage
#TEST_DEV_TYPE=balloon
#TEST_DEV_TYPE=serial
#TEST_DEV_TYPE=usb
#TEST_DEV_TYPE=video

#VNC ports
PORT_BASE=`expr ${UNIQUE_ID} '*' 3`
STUDIO_PORT=`expr ${PORT_BASE} + 0`
CLIENT1_PORT=`expr ${PORT_BASE} + 1`
CLIENT2_PORT=`expr ${PORT_BASE} + 2`

#VIDEO
VIDEO_TYPE=VNC
#VIDEO_TYPE=SPICE

#TEST NETWORK BACKEND
TEST_NET_TYPE=bridge
#TEST_NET_TYPE=OVS

#BRIDGES
WORLD_BR_NAME=whqlbr0
CTRL_BR_NAME=ctrltestbr_${UNIQUE_ID}
TEST_BR_NAME=hcktestbr_${UNIQUE_ID}

#IMAGES
IMAGES_DIR=`dirname ${HCK_ROOT}`/images
STUDIO_IMAGE=${IMAGES_DIR}/HCK_Studio_WS2008R2_SP1.qcow2

if [ -z "${CLIENT1_IMAGE}" ]
then
    CLIENT1_IMAGE=${IMAGES_DIR}/HCK_Client1_WS2008R2_SP1.qcow2
elif [ ! -f ${CLIENT1_IMAGE} ]
then
    CLIENT1_IMAGE=${IMAGES_DIR}/${CLIENT1_IMAGE}
fi

if [ -z "${CLIENT2_IMAGE}" ]
then
    CLIENT2_IMAGE=${IMAGES_DIR}/HCK_Client2_WS2008R2_SP1.qcow2
elif [ ! -f ${CLIENT2_IMAGE} ]
then
    CLIENT2_IMAGE=${IMAGES_DIR}/${CLIENT2_IMAGE}
fi


#RESOURCES
CLIENT1_CPUS=2
CLIENT2_CPUS=2
CLIENT_MEMORY=1G
WORLD_NET_DEVICE=e1000
CTRL_NET_DEVICE=e1000
FILE_TRANSFER_DEVICE=e1000

#MISC
VHOST_STATE=on
SNAPSHOT=off
UNSAFE_CACHE=off
ENABLE_S3=on
ENABLE_S4=on
ENLIGHTENMENTS_STATE=off

#Uncomment the following line and change to the appropriate value
#in order set the title postfix
#TITLE_POSTFIX=foo

#Disable samba network share
#SHARE_ON_HOST=false

#Multiqueueing - uncomment to enable virtio-net multiqueueing
#CLIENT1_N_QUEUES=8
#CLIENT2_N_QUEUES=8

#EXTRA PARAMS
#STUDIO_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"
#CLIENT1_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"
#CLIENT2_EXTRA="-cdrom /non/existing/path/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"

#BIOS from the latest QEMU is required for power management support
#CLIENT1_EXTRA="-bios /non/existing/path/qemu/pc-bios/bios.bin"
#CLIENT2_EXTRA="-bios /non/existing/path/qemu/pc-bios/bios.bin"

#UTILITIES
test x"${SNAPSHOT}" = xon && SNAPSHOT_OPTION="-snapshot"
test x"${UNSAFE_CACHE}" = xon && DRIVE_CACHE_OPTION=",cache=unsafe"
test x"${ENLIGHTENMENTS_STATE}" = xon && ENLIGHTENMENTS_OPTION=,hv_spinlocks=0x1FFF,hv_relaxed

if [ z${ENABLE_S3} ==  zon ]
then
S3_DISABLE_OPTION="0"
else
S3_DISABLE_OPTION="1"
fi

if [ z${ENABLE_S4} ==  zon ]
then
S4_DISABLE_OPTION="0"
else
S4_DISABLE_OPTION="1"
fi

STUDIO_TELNET_PORT=$(( ${STUDIO_PORT} + 10000 ))
CLIENT1_TELNET_PORT=$(( ${CLIENT1_PORT} + 10000 ))
CLIENT2_TELNET_PORT=$(( ${CLIENT2_PORT} + 10000 ))

MONITOR_STUDIO="-monitor telnet::${STUDIO_TELNET_PORT},server,nowait -monitor vc"
MONITOR_CLIENT1="-monitor telnet::${CLIENT1_TELNET_PORT},server,nowait"
MONITOR_CLIENT2="-monitor telnet::${CLIENT2_TELNET_PORT},server,nowait"

if [ z${VIDEO_TYPE} ==  zVNC ]
then
    GRAPHICS_STUDIO="-vnc :${STUDIO_PORT}"

    GRAPHICS_CLIENT1="-vnc :${CLIENT1_PORT}"
    CLIENT1_PORTS_MSG="Vnc ${CLIENT1_PORT}/$(( ${CLIENT1_PORT} + 5900 )) Telnet ${CLIENT1_TELNET_PORT}"

    GRAPHICS_CLIENT2="-vnc :${CLIENT2_PORT}"
    CLIENT2_PORTS_MSG="Vnc ${CLIENT2_PORT}/$(( ${CLIENT2_PORT} + 5900 )) Telnet ${CLIENT2_TELNET_PORT}"

    MONITOR_STDIO="${MONITOR_STDIO} -monitor vc"
    MONITOR_CLIENT1="${MONITOR_CLIENT1} -monitor vc"
    MONITOR_CLIENT2="${MONITOR_CLIENT2} -monitor vc"
fi

if [ z${VIDEO_TYPE} ==  zSPICE ]
then
   GRAPHICS_STUDIO="-vnc :${STUDIO_PORT}"

   CLIENT1_SPICE_PORT=$(( ${CLIENT1_PORT} + 5900 ))
   CLIENT2_SPICE_PORT=$(( ${CLIENT2_PORT} + 5900 ))


   GRAPHICS_CLIENT1="-spice port=${CLIENT1_SPICE_PORT},disable-ticketing -vga qxl -global qxl-vga.revision=3"
   CLIENT1_PORTS_MSG="Spice ${CLIENT1_SPICE_PORT} Telnet ${CLIENT1_TELNET_PORT}"

   GRAPHICS_CLIENT2="-spice port=${CLIENT2_SPICE_PORT},disable-ticketing -vga qxl -global qxl-vga.revision=3"
   CLIENT2_PORTS_MSG="Spice ${CLIENT2_SPICE_PORT} Telnet ${CLIENT2_TELNET_PORT}"
fi

if [ ! -z  "${CLIENT1_N_QUEUES}" ]
then
    CLIENT1_N_VECTORS=$(( ${CLIENT1_N_QUEUES} * 2 + 2))
    CLIENT1_MQ_NETDEV_PARAM=",queues=${CLIENT1_N_QUEUES}"
    CLIENT1_MQ_DEVICE_PARAM=",mq=on,vectors=${CLIENT1_N_VECTORS}"
fi

if [ ! -z  "${CLIENT2_N_QUEUES}" ]
then
    CLIENT2_N_VECTORS=$(( ${CLIENT2_N_QUEUES} * 2 + 2))
    CLIENT2_MQ_NETDEV_PARAM=",queues=${CLIENT2_N_QUEUES}"
    CLIENT2_MQ_DEVICE_PARAM=",mq=on,vectors=${CLIENT2_N_VECTORS}"
fi

if [ ! -z "${TITLE_POSTFIX}" ]
then
    _TITLE_POSTFIX=_${TITLE_POSTFIX}
fi

#SMB share on host
if [ -z "$SHARE_ON_HOST" ] || [ "$SHARE_ON_HOST" == "default" ]
then
   SHARE_ON_HOST=${HCK_ROOT}/SMB_SHARE  # The default share on the host
fi

if [ -d "$SHARE_ON_HOST" ] && [ "$SHARE_ON_HOST" != "false" ]
then
   SHARE_ON_HOST=`cd ${SHARE_ON_HOST} && pwd`  # Get the absolute path
elif [ "$SHARE_ON_HOST" != "false" ]
then
   echo "Directory ${SHARE_ON_HOST} does not exist!"
   echo "Either create it, or modify the \"SHARE_ON_HOST\" environmental variable."
   echo "Running withoput a share..."
   SHARE_ON_HOST="false"
fi

remove_bridges() {
  case $TEST_NET_TYPE in
  bridge)
     ifconfig ${TEST_BR_NAME} down
     brctl delbr ${TEST_BR_NAME}
     ;;
  OVS)
     ovs-vsctl del-br ${TEST_BR_NAME}
     ;;
{'fraction_non_alphanumeric': 0.1339571960835283, 'fraction_numerical': 0.0377783554284724, 'mean_word_length': 6.046398046398046, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1621420', 'n_tokens_mistral': 5128, 'n_tokens_neox': 4980, 'n_words': 838}