<commit_before>test_basic_usage() {
  if ! lxc image alias list | grep -q ^testimage$; then
    if [ -e "$LXD_TEST_IMAGE" ]; then
        IMAGE_SHA256=$(sha256sum "$LXD_TEST_IMAGE" | cut -d ' ' -f1)
        lxc image import $LXD_TEST_IMAGE
        lxc image alias create testimage $IMAGE_SHA256
    else
        ../scripts/lxd-images import lxc ubuntu trusty amd64 --alias testimage
    fi
  fi

  lxc launch testimage foo
  # should fail if foo isn't running
  lxc stop foo
  lxc delete foo

  lxc init testimage foo

  # did it get created?
  lxc list | grep foo

  # cycle it a few times
  lxc start foo
  lxc stop foo
  lxc start foo

  # Make sure it is the right version
  lxc exec foo /bin/cat /etc/issue | grep 14.04
  echo foo | lxc exec foo tee /tmp/foo

  # This is why we can't have nice things.
  content=$(cat "${LXD_DIR}/lxc/foo/rootfs/tmp/foo")
  [ "$content" = "foo" ]

  # cleanup
  lxc stop foo
  lxc delete foo

  # now, make sure create type 'none' works
  mkdir -p "${LXD_DIR}/lxc/nonetype"
  wait_for my_curl -X POST $BASEURL/1.0/containers -d '{"name": "nonetype", "source": {"type": "none"}}'
  rm -rf "${LXD_DIR}/lxc/nonetype"

  # and creating with a config
  wait_for my_curl -X POST $BASEURL/1.0/containers -d "{\"name\":\"configtest\",\"config\":{\"raw.lxc\":\"lxc.hook.clone=/bin/true\"},\"source\":{\"type\":\"none\"}}"
  [ "$(my_curl $BASEURL/1.0/containers/configtest | jq -r .metadata.config[\"raw.lxc\"])" = "lxc.hook.clone=/bin/true" ]
  lxc delete configtest
}<commit_msg>Revert "Don't --force stop in tests, since it's no longer hanging"<commit_after>test_basic_usage() {
  if ! lxc image alias list | grep -q ^testimage$; then
    if [ -e "$LXD_TEST_IMAGE" ]; then
        IMAGE_SHA256=$(sha256sum "$LXD_TEST_IMAGE" | cut -d ' ' -f1)
        lxc image import $LXD_TEST_IMAGE
        lxc image alias create testimage $IMAGE_SHA256
    else
        ../scripts/lxd-images import lxc ubuntu trusty amd64 --alias testimage
    fi
  fi

  lxc launch testimage foo
  # should fail if foo isn't running
  lxc stop foo --force  # stop is hanging
  lxc delete foo

  lxc init testimage foo

  # did it get created?
  lxc list | grep foo

  # cycle it a few times
  lxc start foo
  lxc stop foo  --force # stop is hanging
  lxc start foo

  # Make sure it is the right version
  lxc exec foo /bin/cat /etc/issue | grep 14.04
  echo foo | lxc exec foo tee /tmp/foo

  # This is why we can't have nice things.
  content=$(cat "${LXD_DIR}/lxc/foo/rootfs/tmp/foo")
  [ "$content" = "foo" ]

  # cleanup
  lxc stop foo  --force # stop is hanging
  lxc delete foo

  # now, make sure create type 'none' works
  mkdir -p "${LXD_DIR}/lxc/nonetype"
  wait_for my_curl -X POST $BASEURL/1.0/containers -d '{"name": "nonetype", "source": {"type": "none"}}'
  rm -rf "${LXD_DIR}/lxc/nonetype"

  # and creating with a config
  wait_for my_curl -X POST $BASEURL/1.0/containers -d "{\"name\":\"configtest\",\"config\":{\"raw.lxc\":\"lxc.hook.clone=/bin/true\"},\"source\":{\"type\":\"none\"}}"
  [ "$(my_curl $BASEURL/1.0/containers/configtest | jq -r .metadata.config[\"raw.lxc\"])" = "lxc.hook.clone=/bin/true" ]
  lxc delete configtest
}
{'fraction_non_alphanumeric': 0.14457831325301204, 'fraction_numerical': 0.013950538998097653, 'mean_word_length': 2.948685857321652, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, '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': '6908009', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1142, 'n_words': 356}