<commit_before>#! /bin/bash

. ./config.sh

C1=10.2.1.34
C2=10.2.1.37
C3=10.2.2.34
C4=10.2.2.37
EXP=10.2.1.101

weave_on1() {
    assert_raises "weave_on $HOST1 $@"
}

run_on1() {
    assert_raises "run_on   $HOST1 $@"
}

exec_on1() {
    assert_raises "exec_on  $HOST1 $@"
}

check_container_connectivity() {
    exec_on1 "c1 $PING $C2"
    exec_on1 "c3 $PING $C4"
    # fails due to #620
    # exec_on1 "c3 ! $PING $C1"
}

start_suite "exposing weave network to host"

weave_on $HOST1 launch

start_container $HOST1 $C1/24 --name=c1
start_container $HOST1 $C2/24 --name=c2
start_container $HOST1 $C3/24 --name=c3
start_container $HOST1 $C4/24 --name=c4

# absence of host connectivity by default
run_on1 "! $PING $C1"<commit_msg>Add smoke tests for 'weave expose' and 'weave hide' when weave isn't running<commit_after>#! /bin/bash

. ./config.sh

C1=10.2.1.34
C2=10.2.1.37
C3=10.2.2.34
C4=10.2.2.37
EXP=10.2.1.101

weave_on1() {
    assert_raises "weave_on $HOST1 $@"
}

run_on1() {
    assert_raises "run_on   $HOST1 $@"
}

exec_on1() {
    assert_raises "exec_on  $HOST1 $@"
}

check_container_connectivity() {
    exec_on1 "c1 $PING $C2"
    exec_on1 "c3 $PING $C4"
    # fails due to #620
    # exec_on1 "c3 ! $PING $C1"
}

start_suite "exposing weave network to host"

# expose/hide work prior to launching weave
run_on1   "! $PING $EXP"
weave_on1 "expose  $EXP/24"
run_on1   "  $PING $EXP"
weave_on1 "hide    $EXP/24"
run_on1   "! $PING $EXP"

weave_on $HOST1 launch

start_container $HOST1 $C1/24 --name=c1
start_container $HOST1 $C2/24 --name=c2
start_container $HOST1 $C3/24 --name=c3
start_container $HOST1 $C4/24 --name=c4

# absence of host connectivity by default
run_on1 "! $PING $C1"
{'fraction_non_alphanumeric': 0.1475602586713698, 'fraction_numerical': 0.09465020576131687, 'mean_word_length': 3.538666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, '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': '1324301', 'n_tokens_mistral': 834, 'n_tokens_neox': 774, 'n_words': 174}