Example #1
0
 def test_ssh_untrusted(self):
     client = self.a._setup_ssh_connection(self.default_comp_config["host"], self.default_comp_config["username"])
     with capture_output() as (out, err):
         x = self.a._ssh_untrusted(self.default_comp_config, client)
     out = out[0]
     assert_is_not_none(x)
     assert_is_instance(x,int)
 def test_ssh_untrusted(self):
     client = self.a._setup_ssh_connection(self.default_comp_config["host"], self.default_comp_config["username"])
     with capture_output() as (out, err):
         x = self.a._ssh_untrusted(self.default_comp_config, client)
     out = out[0]
     assert_is_not_none(x)
     assert_is_instance(x, int)
Example #3
0
    def test_add_computer_success(self): # depends on _setup_ssh_connection, _ssh_untrusted
        new_config = self.default_comp_config.copy()
        new_config.update({'beat_interval': 0.5, 'first_beat': 1, 'kernels': {}})

        with capture_output(split=True) as (out,err):
            x = self.a.add_computer(self.default_comp_config)
        assert_is_not_none(x)
        assert_uuid(x)
        assert_in(x, self.a._comps)
        for k in new_config:
            assert_equal(self.a._comps[x][k], new_config[k], "config value %s (%s) does not agree (should be %s)"%(k,self.a._comps[x][k], new_config[k]))

        assert_in("ssh", self.a._clients[x])

        #assert_regexp_matches(out[0], self.executing_re)
        assert_regexp_matches(out[0], r'ZMQ Connection with computer [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12} at port \d+ established')
    def test_add_computer_success(self):  # depends on _setup_ssh_connection, _ssh_untrusted
        new_config = self.default_comp_config.copy()
        new_config.update({"beat_interval": 0.5, "first_beat": 1, "kernels": {}})

        with capture_output(split=True) as (out, err):
            x = self.a.add_computer(self.default_comp_config)
        assert_is_not_none(x)
        assert_uuid(x)
        assert_in(x, self.a._comps)
        for k in new_config:
            assert_equal(
                self.a._comps[x][k],
                new_config[k],
                "config value %s (%s) does not agree (should be %s)" % (k, self.a._comps[x][k], new_config[k]),
            )

        assert_in("ssh", self.a._clients[x])

        # assert_regexp_matches(out[0], self.executing_re)
        assert_regexp_matches(
            out[0],
            r"ZMQ Connection with computer [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12} at port \d+ established",
        )