909a943b67b6b472a2d77afa13a8caa61f25f972,distributed/tests/test_security.py,,test_listen_args,#,205

Before Change


        if sys.version_info >= (3, 6):
            assert len(ctx.get_ciphers()) > 2  // Most likely

    c = {
        "tls": {
            "ca-file": ca_file,
            "scheduler": {"key": key1, "cert": cert1},
            "worker": {"cert": keycert1},
        }
    }
    with new_config(c):
        sec = Security()

    d = sec.get_listen_args("scheduler")
    assert not d["require_encryption"]
    ctx = d["ssl_context"]
    basic_checks(ctx)
    many_ciphers(ctx)

    d = sec.get_listen_args("worker")
    ctx = d["ssl_context"]
    basic_checks(ctx)
    many_ciphers(ctx)

    // No cert defined => no TLS
    d = sec.get_listen_args("client")
    assert d.get("ssl_context") is None

    // With more settings
    c["tls"]["ciphers"] = FORCED_CIPHER
    c["require-encryption"] = True

    with new_config(c):
        sec = Security()

    d = sec.get_listen_args("scheduler")

After Change


        if sys.version_info >= (3, 6):
            assert len(ctx.get_ciphers()) > 2  // Most likely

    c = {
        "distributed.comm.tls.ca-file": ca_file,
        "distributed.comm.tls.scheduler.key": key1,
        "distributed.comm.tls.scheduler.cert": cert1,
        "distributed.comm.tls.worker.cert": keycert1,
    }
    with dask.config.set(c):
        sec = Security()

    d = sec.get_listen_args("scheduler")
    assert not d["require_encryption"]
    ctx = d["ssl_context"]
    basic_checks(ctx)
    many_ciphers(ctx)

    d = sec.get_listen_args("worker")
    ctx = d["ssl_context"]
    basic_checks(ctx)
    many_ciphers(ctx)

    // No cert defined => no TLS
    d = sec.get_listen_args("client")
    assert d.get("ssl_context") is None

    // With more settings
    c["distributed.comm.tls.ciphers"] = FORCED_CIPHER
    c["distributed.comm.require-encryption"] = True

    with dask.config.set(c):
        sec = Security()

    d = sec.get_listen_args("scheduler")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 25

Instances


Project Name: dask/distributed
Commit Name: 909a943b67b6b472a2d77afa13a8caa61f25f972
Time: 2019-07-25
Author: jcrist@users.noreply.github.com
File Name: distributed/tests/test_security.py
Class Name:
Method Name: test_listen_args


Project Name: dask/distributed
Commit Name: 909a943b67b6b472a2d77afa13a8caa61f25f972
Time: 2019-07-25
Author: jcrist@users.noreply.github.com
File Name: distributed/tests/test_security.py
Class Name:
Method Name: test_listen_args


Project Name: dask/distributed
Commit Name: 909a943b67b6b472a2d77afa13a8caa61f25f972
Time: 2019-07-25
Author: jcrist@users.noreply.github.com
File Name: distributed/tests/test_security.py
Class Name:
Method Name: test_connection_args


Project Name: dask/distributed
Commit Name: 909a943b67b6b472a2d77afa13a8caa61f25f972
Time: 2019-07-25
Author: jcrist@users.noreply.github.com
File Name: distributed/tests/test_security.py
Class Name:
Method Name: test_tls_listen_connect