<commit_before>#!/bin/sh
set -e
set -x


PROFILE=TEST_PROFILE
dist/calicoctl profile add $PROFILE
TAG=TEST_TAG

# Test that the profile rule update command successfully updates.
echo '{
  "id": "TEST_PROFILE",
  "inbound_rules": [
    {
      "action": "allow",
      "src_tag": "TEST_PROFILE"
    },
    {
      "action": "deny"
    }
  ],
  "outbound_rules": [
    {
      "action": "deny"
    }
  ]
}' | dist/calicoctl profile $PROFILE rule update

dist/calicoctl profile $PROFILE rule show | grep "1 deny"

# Test that adding and removing a tag works.
! (dist/calicoctl profile $PROFILE tag show | grep $TAG)
dist/calicoctl profile $PROFILE tag add $TAG
dist/calicoctl profile $PROFILE tag show | grep $TAG
dist/calicoctl profile $PROFILE tag remove $TAG
! (dist/calicoctl profile $PROFILE tag show | grep $TAG)

echo "Tests completed successfully"<commit_msg>Put parens around negated commands.<commit_after>#!/bin/sh
set -e
set -x


PROFILE=TEST_PROFILE
dist/calicoctl profile add $PROFILE
TAG=TEST_TAG

# Test that the profile rule update command successfully updates.
echo '{
  "id": "TEST_PROFILE",
  "inbound_rules": [
    {
      "action": "allow",
      "src_tag": "TEST_PROFILE"
    },
    {
      "action": "deny"
    }
  ],
  "outbound_rules": [
    {
      "action": "deny"
    }
  ]
}' | dist/calicoctl profile $PROFILE rule update

dist/calicoctl profile $PROFILE rule show | grep "1 deny"

# Test that adding and removing a tag works.
(! dist/calicoctl profile $PROFILE tag show | grep $TAG)
dist/calicoctl profile $PROFILE tag add $TAG
dist/calicoctl profile $PROFILE tag show | grep $TAG
dist/calicoctl profile $PROFILE tag remove $TAG
(! dist/calicoctl profile $PROFILE tag show | grep $TAG)

echo "Tests completed successfully"
{'fraction_non_alphanumeric': 0.11485714285714285, 'fraction_numerical': 0.001142857142857143, 'mean_word_length': 3.5598958333333335, 'pattern_counts': {'":': 14, '<': 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': '96275', 'n_tokens_mistral': 597, 'n_tokens_neox': 584, 'n_words': 185}