Skip to content

Conversation

@Connor-GH
Copy link

No description provided.

This was caught when testing chmod inside of Redox OS.
Previously, doing `chmod 10777 file` will cause an error stating that
"mode is too large (4607 > 7777", which is both incorrect and contains
a missing parenthesis. We now print the large octal value in terms of
octal.
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

could you please add a test to make sure we don't regress in the future? thanks

@ChrisDryden
Copy link
Collaborator

Heres an example test for this scenario for chmod that you can use in test_chmod:

#[test]
fn test_chmod_mode_too_large_error_shows_octal() {
    let scene = TestScenario::new(util_name!());
    let at = &scene.fixtures;
    at.touch("file");

    scene
        .ucmd()
        .arg("10777")
        .arg("file")
        .fails()
        .stderr_contains("mode is too large (10777 > 7777)");

    scene
        .ucmd()
        .arg("77777")
        .arg("file")
        .fails()
        .stderr_contains("mode is too large (77777 > 7777)");
}

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

Successfully merging this pull request may close these issues.

3 participants