• E
    test-qga: Kill broken and dead QGA_TEST_SIDE_EFFECTING code · f94b3f64
    Eric Blake 提交于
    Back when the test was introduced, in commit 62c39b30, the
    test was set up to run qemu-ga directly on the host performing
    the test, and defaults to limiting itself to safe commands.  At
    the time, it was envisioned that setting QGA_TEST_SIDE_EFFECTING
    in the environment could cover a few more commands, while noting
    the potential danger of those side effects running in the host.
    
    But this has NEVER been tested: if you enable the environment
    variable, the test WILL fail.  One obvious reason: if you are not
    running as root, you'll probably get a permission failure when
    trying to freeze the file systems, or when changing system time.
    Less obvious: if you run the test as root (wow, you're brave), you
    could end up hanging if the test tries to log things to a
    temporarily frozen filesystem.  But the cutest reason of all: if
    you get past the above hurdles, the test uses invalid JSON in
    test_qga_fstrim() (missing '' around the dictionary key 'minimum'),
    and will thus fail an assertion in qmp_fd().
    
    Rather than leave this untested time-bomb in place, rip it out.
    Hopefully, as originally envisioned, we can find an opportunity
    to test an actual sandboxed guest where the guest-agent has
    full permissions and will not unduly affect the host running
    the test - if so, 'git revert' can be used if desired, for
    salvaging any useful parts of this attempt.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: NThomas Huth <thuth@redhat.com>
    Signed-off-by: NThomas Huth <thuth@redhat.com>
    f94b3f64
test-qga.c 28.4 KB