<commit_before>#!/usr/local/bin/bash

# Where is the pcbsd-build program installed
PROGDIR="`realpath | sed 's|/scripts$||g'`" ; export PROGDIR

# Make sure we have all the required packages installed
${PROGDIR}/scripts/checkprogs.sh

# Source our functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh

if [ ! -d "${PROGDIR}/tmp" ] ; then
  mkdir ${PROGDIR}/tmp
fi

# Figure out the flavor for this test
echo $BUILDTAG | grep -q "truenas"
if [ $? -eq 0 ] ; then
  FLAVOR="TRUENAS"
else
  FLAVOR="FREENAS"
fi

# Source our resty / jsawk functions
. ${PROGDIR}/../utils/resty -W "http://${LIVEHOST}:80/api/v1.0" -H "Accept: application/json" -H "Content-Type: application/json" -u ${LIVEUSER}:${LIVEPASS}

# Start the XML reporting
start_xml_results "Live Testing"

# Check that the server is up and ready to answer calls
set_test_group_text "Testing Connectivity" "1"
echo_test_title "Testing access to REST API"
wait_for_avail
echo_ok

if [ "$FLAVOR" = "FREENAS" ] ; then
  set_test_group_text "Upgrade Test" "2"

  # Checking for updates
  echo_test_title "Checking for available updates"
  rest_request "GET" "/system/update/check/" ""
  check_rest_response "200 OK"

  # Do the update now
  echo_test_title "Performing upgrade of system"
  rest_request "POST" "/system/update/update/" ""
  check_rest_response "200 OK"

  # Wait for system to reboot
  echo_test_title "Waiting for reboot"
  sleep 20
  wait_for_avail
  echo_ok
else
  # For TrueNAS we have to do the update in two stages, one for each head
  foo=1

fi

finish_xml_results<commit_msg>Remove string from REST upgrade request<commit_after>#!/usr/local/bin/bash

# Where is the pcbsd-build program installed
PROGDIR="`realpath | sed 's|/scripts$||g'`" ; export PROGDIR

# Make sure we have all the required packages installed
${PROGDIR}/scripts/checkprogs.sh

# Source our functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh

if [ ! -d "${PROGDIR}/tmp" ] ; then
  mkdir ${PROGDIR}/tmp
fi

# Figure out the flavor for this test
echo $BUILDTAG | grep -q "truenas"
if [ $? -eq 0 ] ; then
  FLAVOR="TRUENAS"
else
  FLAVOR="FREENAS"
fi

# Source our resty / jsawk functions
. ${PROGDIR}/../utils/resty -W "http://${LIVEHOST}:80/api/v1.0" -H "Accept: application/json" -H "Content-Type: application/json" -u ${LIVEUSER}:${LIVEPASS}

# Start the XML reporting
start_xml_results "Live Testing"

# Check that the server is up and ready to answer calls
set_test_group_text "Testing Connectivity" "1"
echo_test_title "Testing access to REST API"
wait_for_avail
echo_ok

if [ "$FLAVOR" = "FREENAS" ] ; then
  set_test_group_text "Upgrade Test" "2"

  # Checking for updates
  echo_test_title "Checking for available updates"
  rest_request "GET" "/system/update/check/" ""
  check_rest_response "200 OK"

  # Do the update now
  echo_test_title "Performing upgrade of system"
  rest_request "POST" "/system/update/update/"
  check_rest_response "200 OK"

  # Wait for system to reboot
  echo_test_title "Waiting for reboot"
  sleep 20
  wait_for_avail
  echo_ok
else
  # For TrueNAS we have to do the update in two stages, one for each head
  foo=1

fi

finish_xml_results
{'fraction_non_alphanumeric': 0.11421399435205522, 'fraction_numerical': 0.01004079071226859, 'mean_word_length': 4.234811165845649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4491811', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1110, 'n_words': 342}