<commit_before>#!/bin/bash
export BOOTSTRAP_LOG="test.log"
echo "" > $BOOTSTRAP_LOG
source .functions.sh

trap 'kill $(jobs -p); kpartx -dv "$image"' EXIT
ssh-keygen -f ~/.ssh/known_hosts -R [localhost]:2222


function sshc() {
	sshpass -p '<PASSWORD>' ssh -p 2222 -oStrictHostKeyChecking=no -oConnectTimeout=10 root@localhost "$1" 2>> test.log
	return $?
}

function waitForConnection() {
	seq 0 12 | while read i; do
		sshc id && break || sleep 10
	done
}

export -f waitForConnection sshc
#### main ####

image="$1"

DEVICE="`kpartx -av "$image" | head -n1 | cut -d" " -f8`"
qemu-system-x86_64 -nographic -enable-kvm -hda $DEVICE*2  -net user,hostfwd=tcp::8000-:80,hostfwd=tcp::2222-:22,hostfwd=tcp::9080-:8080 -net nic -m 2048 &


check "Wait for ssh connectivity" \
	'[ "$(waitForConnection)" == "uid=0(root) gid=0(root) groups=0(root)" ] || false'

check "Test Janosh availability" \
	'[ $(sshc "/lounge/bin/janosh hash") == "10577639537861785865" ] || false'

check "Test JanoshAPI availability" \
	"sshc 'bash -lc /third/Janosh/src/JanoshAPI.lua'"<commit_msg>tests are working but not returning zero<commit_after>#!/bin/bash
export BOOTSTRAP_LOG="test.log"
echo "" > $BOOTSTRAP_LOG
source .functions.sh

trap 'kill $(jobs -p); kpartx -dv "$image"' EXIT
ssh-keygen -f ~/.ssh/known_hosts -R [localhost]:2222


function sshc() {
	sshpass -p '<PASSWORD>' ssh -p 2222 -oStrictHostKeyChecking=no -oConnectTimeout=10 root@localhost "$1" 2>> test.log
	return $?
}

function waitForConnection() {
	seq 0 12 | while read i; do
		sshc id && break || sleep 10
	done
}

export -f waitForConnection sshc
#### main ####

image="$1"

DEVICE="`kpartx -av "$image" | head -n1 | cut -d" " -f8`"
qemu-system-x86_64 -nographic -enable-kvm -hda $DEVICE*2  -net user,hostfwd=tcp::8000-:80,hostfwd=tcp::2222-:22,hostfwd=tcp::9080-:8080 -net nic -m 2048 &


check "Wait for ssh connectivity" \
	'[ "$(waitForConnection)" == "uid=0(root) gid=0(root) groups=0(root)" ] || false'

check "Test Janosh availability" \
	'[ $(sshc "/lounge/bin/janosh hash") == "10577639537861785865" ] || false'

check "Test JanoshAPI availability" \
	"sshc 'bash -lc /third/Janosh/src/JanoshAPI.lua'"

exit 0
{'fraction_non_alphanumeric': 0.1761180267404334, 'fraction_numerical': 0.06685108344859382, 'mean_word_length': 4.398009950248756, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1097836', 'n_tokens_mistral': 968, 'n_tokens_neox': 840, 'n_words': 211}