Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert datadir pytest into CI tests #50

Open
AbcSxyZ opened this issue Dec 17, 2021 · 0 comments
Open

Convert datadir pytest into CI tests #50

AbcSxyZ opened this issue Dec 17, 2021 · 0 comments

Comments

@AbcSxyZ
Copy link
Contributor

AbcSxyZ commented Dec 17, 2021

Convert test from #25 to CI tests using integration test framework.

def test_datadir(hook, host):
    """
    Verify if datadir can be changed and created proprely.

    Verify datadir metada, if it's owned by script user (dogecoin).
    """
    # Use a unique directory for this test
    tmp_datadir = "/tmp/datadir_test"
    datadir_argument = f"-datadir={tmp_datadir}"

    test_args = ["dogecoind", datadir_argument]
    test_environ = {}

    result_args = [
            pytest.abs_path("dogecoind"),
            datadir_argument,
            "-printtoconsole",
            ]
    result_environ = {}

    # Run test to generate datadir
    hook.test(test_args, test_environ, result_args, result_environ)
    assert hook.result == hook.reference

    # Test datadir metadata
    datadir_folder = host.file(tmp_datadir)
    assert datadir_folder.user == pytest.user
    assert datadir_folder.group == pytest.user
    assert datadir_folder.mode == 0o755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant