mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tests: authconfigtest: move declarations
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7923996d77
commit
33e3c69320
@ -84,20 +84,6 @@ mymain(void)
|
|||||||
|
|
||||||
virAuthConfigPtr config;
|
virAuthConfigPtr config;
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
signal(SIGPIPE, SIG_IGN);
|
|
||||||
#endif /* WIN32 */
|
|
||||||
|
|
||||||
#define TEST_LOOKUP(config, hostname, service, credname, expect) \
|
|
||||||
do { \
|
|
||||||
const struct ConfigLookupData data = { \
|
|
||||||
config, hostname, service, credname, expect \
|
|
||||||
}; \
|
|
||||||
if (virTestRun("Test Lookup " hostname "-" service "-" credname, \
|
|
||||||
testAuthLookup, &data) < 0) \
|
|
||||||
ret = -1; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
const char *confdata =
|
const char *confdata =
|
||||||
"[credentials-test]\n"
|
"[credentials-test]\n"
|
||||||
"username=fred\n"
|
"username=fred\n"
|
||||||
@ -119,6 +105,20 @@ mymain(void)
|
|||||||
"[auth-libvirt-prod1.example.com]\n"
|
"[auth-libvirt-prod1.example.com]\n"
|
||||||
"credentials=prod\n";
|
"credentials=prod\n";
|
||||||
|
|
||||||
|
#define TEST_LOOKUP(config, hostname, service, credname, expect) \
|
||||||
|
do { \
|
||||||
|
const struct ConfigLookupData data = { \
|
||||||
|
config, hostname, service, credname, expect \
|
||||||
|
}; \
|
||||||
|
if (virTestRun("Test Lookup " hostname "-" service "-" credname, \
|
||||||
|
testAuthLookup, &data) < 0) \
|
||||||
|
ret = -1; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
if (!(config = virAuthConfigNewData("auth.conf", confdata, strlen(confdata))))
|
if (!(config = virAuthConfigNewData("auth.conf", confdata, strlen(confdata))))
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user