aboutsummaryrefslogtreecommitdiff
path: root/qga/meson.build
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-10-20 12:12:52 +0400
committerMichael Roth <michael.roth@amd.com>2020-11-02 19:58:15 -0600
commit8d769ec777dccbff199711aba43aa6297fe4a0e0 (patch)
tree4b2cd07e60b695ac8a3d55c4b82871b2a68211b2 /qga/meson.build
parent6d593ab451c490b0ca941c6a519894231634751e (diff)
downloadqemu-8d769ec777dccbff199711aba43aa6297fe4a0e0.zip
qemu-8d769ec777dccbff199711aba43aa6297fe4a0e0.tar.gz
qemu-8d769ec777dccbff199711aba43aa6297fe4a0e0.tar.bz2
qga: add ssh-{add,remove}-authorized-keys
Add new commands to add and remove SSH public keys from ~/.ssh/authorized_keys. I took a different approach for testing, including the unit tests right with the code. I wanted to overwrite the function to get the user details, I couldn't easily do that over QMP. Furthermore, I prefer having unit tests very close to the code, and unit files that are domain specific (commands-posix is too crowded already). FWIW, that coding/testing style is Rust-style (where tests can or should even be part of the documentation!). Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1885332 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> *squashed in fix-ups for setting file ownership and use of QAPI conditionals for CONFIG_POSIX instead of stub definitions *disable qga-ssh-test for now due to G_TEST_OPTION_ISOLATE_DIRS triggering leak detector in build-oss-fuzz *fix disallowed g_assert* usage reported by checkpatch Signed-off-by: Michael Roth <michael.roth@amd.com>
Diffstat (limited to 'qga/meson.build')
-rw-r--r--qga/meson.build25
1 files changed, 24 insertions, 1 deletions
diff --git a/qga/meson.build b/qga/meson.build
index cd08bd9..635de9a 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -35,7 +35,9 @@ qga_ss.add(files(
))
qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
'channel-posix.c',
- 'commands-posix.c'))
+ 'commands-posix.c',
+ 'commands-posix-ssh.c',
+))
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
'channel-win32.c',
'commands-win32.c',
@@ -87,3 +89,24 @@ else
endif
alias_target('qemu-ga', all_qga)
+
+test_env = environment()
+test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
+test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
+
+# disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
+# the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
+# this when an alternative is implemented or when the underlying glib
+# issue is identified/fix
+#if 'CONFIG_POSIX' in config_host
+if false
+ qga_ssh_test = executable('qga-ssh-test',
+ files('commands-posix-ssh.c'),
+ dependencies: [qemuutil],
+ c_args: ['-DQGA_BUILD_UNIT_TEST'])
+
+ test('qga-ssh-test',
+ qga_ssh_test,
+ env: test_env,
+ suite: ['unit', 'qga'])
+endif