<commit_before>import base
from base import skipUnlessTrue, skipUnlessFalse
import sys
from time import sleep

class MultiBrNonRegressionScenarios(base.TestScenarios):
    @skipUnlessTrue("S1")
    def test_S1_move_mote_disjoint(self):
        """
        Ping from the computer to the mote when the PC knows the BR but the BR does not know the
        mote.
        """
        self.assertTrue(self.support.start_6lbr(), "Could not start 6LBR")
        self.set_up_network()
        self.assertTrue(self.support.start_mote(), "Could not start up mote")
        self.assertTrue(self.support.start_udp_client(), "Could not start udp traffic")
        self.assertTrue(self.support.wait_mote_in_6lbr(30), "Mote not detected")
        self.assertTrue(self.support.wait_ping_mote(60), "Mote is not responding")
        print >> sys.stderr, "Moving mote..."
        self.support.wsn.move_mote(self.support.test_mote.mote_id, -1)
        sleep(5)
        self.assertTrue(self.support.wait_ping_mote(240), "Mote is not responding")
        self.assertTrue(self.support.stop_mote(), "Could not stop mote")
        self.tear_down_network()
        self.assertTrue(self.support.stop_6lbr(), "Could not stop 6LBR")

    @skipUnlessTrue("S2")
    def test_S2_move_mote_overlap(self):
        pass
    
    @skipUnlessTrue("S3")
    def test_S3_br_failure(self):
        pass
<commit_msg>Add BR failure test<commit_after>import base
from base import skipUnlessTrue, skipUnlessFalse
import sys
from time import sleep

class MultiBrNonRegressionScenarios(base.TestScenarios):
    @skipUnlessTrue("S1")
    def test_S1_move_mote_disjoint(self):
        """
        Ping from the computer to the mote when the PC knows the BR but the BR does not know the
        mote.
        """
        self.assertTrue(self.support.start_6lbr(), "Could not start 6LBR")
        self.set_up_network()
        self.assertTrue(self.support.start_mote(), "Could not start up mote")
        self.assertTrue(self.support.start_udp_client(), "Could not start udp traffic")
        self.assertTrue(self.support.wait_mote_in_6lbr(30), "Mote not detected")
        self.assertTrue(self.support.wait_ping_mote(60), "Mote is not responding")
        print >> sys.stderr, "Moving mote..."
        self.support.wsn.move_mote(self.support.test_mote.mote_id, -1)
        sleep(5)
        self.assertTrue(self.support.wait_ping_mote(240), "Mote is not responding")
        self.assertTrue(self.support.stop_mote(), "Could not stop mote")
        self.tear_down_network()
        self.assertTrue(self.support.stop_6lbr(), "Could not stop 6LBR")

    @skipUnlessTrue("S2")
    def test_S2_move_mote_overlap(self):
        pass
    
    @skipUnlessTrue("S3")
    def test_S3_br_failure(self):
        self.assertTrue(self.support.start_6lbr(), "Could not start 6LBR")
        self.set_up_network()
        self.assertTrue(self.support.start_mote(), "Could not start up mote")
        self.assertTrue(self.support.start_udp_client(), "Could not start udp traffic")
        self.assertTrue(self.support.wait_mote_in_6lbr(30), "Mote not detected")
#         if mote_start_delay > 0:
#             print >> sys.stderr, "Wait %d s for DAG stabilisation" % mote_start_delay
#             time.sleep(mote_start_delay)
        self.assertTrue(self.support.wait_ping_mote(60), "Mote is not responding")
        print >> sys.stderr, "Killing BR..."
        self.assertTrue(self.support.brList[0].stop_6lbr(), "Could not stop 6LBR")
        self.assertTrue(self.support.wait_ping_mote(600), "Mote is not responding")
        self.assertTrue(self.support.stop_mote(), "Could not stop mote")
        self.tear_down_network()
        self.assertTrue(self.support.stop_6lbr(), "Could not stop 6LBR")

{'fraction_non_alphanumeric': 0.11143852129654433, 'fraction_numerical': 0.015001339405304044, 'mean_word_length': 3.2674285714285713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '4601139', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1225, 'n_words': 261}