Page MenuHomeFreeBSD

Fix geom tests after argument changes
ClosedPublic

Authored by brd on Oct 29 2021, 5:18 PM.
Tags
Referenced Files
Unknown Object (File)
Tue, Apr 16, 11:01 AM
Unknown Object (File)
Sun, Apr 14, 2:38 AM
Unknown Object (File)
Thu, Mar 28, 8:46 PM
Unknown Object (File)
Jan 14 2024, 6:08 AM
Unknown Object (File)
Jan 1 2024, 1:51 AM
Unknown Object (File)
Jan 1 2024, 1:48 AM
Unknown Object (File)
Jan 1 2024, 1:43 AM
Unknown Object (File)
Dec 14 2023, 1:08 AM

Details

Summary

After the changes in 68bff4a07e3fa6c30a0c0ff6cf5f0bef95dcbd72, the tests need to be updated to account for the change in output.

Test Plan

kyua test

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brd requested review of this revision.Oct 29 2021, 5:18 PM

Do these utilities always run in verbose mode now?

I am also checking this, but what I haven't figured out is that it seems these test cases don't execute geom utility commands with -v so it should not expect the output from verbose mode. Is there anything I missed that those test cases do enable the verbose flag?

Shouldn't the root cause be fixed (geom be revert back to non-verbose mode by default) in place of fixing the regression test ?

Shouldn't the root cause be fixed (geom be revert back to non-verbose mode by default) in place of fixing the regression test ?

Yes. I've sent e-mail to Kirk about it, but I've not heard back yet. I've looked enough at his patch to convince myself that the new output is a bug, but I've not managed to figure out how to fix it.

Sorry for my long delay.

I concur that it is my change that should be fixed, not these tests.

I believe that the correct fix is this:

diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c
index 2e0d8683df49..0202be9a063e 100644
--- a/sbin/geom/core/geom.c
+++ b/sbin/geom/core/geom.c
@@ -445,7 +445,7 @@ set_flags(struct g_command *cmd)
 {
        unsigned flags = 0;

-       if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0)
+       if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0 && verbose)
                flags |= G_FLAG_VERBOSE;

        return (flags);

Sorry for my long delay.

I concur that it is my change that should be fixed, not these tests.

I believe that the correct fix is this:

diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c
index 2e0d8683df49..0202be9a063e 100644
--- a/sbin/geom/core/geom.c
+++ b/sbin/geom/core/geom.c
@@ -445,7 +445,7 @@ set_flags(struct g_command *cmd)
 {
        unsigned flags = 0;

-       if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0)
+       if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0 && verbose)
                flags |= G_FLAG_VERBOSE;

        return (flags);

Thanks. That seems to fix it all.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 11 2021, 8:12 PM
This revision was automatically updated to reflect the committed changes.