summaryrefslogtreecommitdiff
path: root/libnm-util/tests/Makefile.am
blob: 4e2a8a78e17446b8654da0f046eb5973ce79c36d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
SUBDIRS=certs

INCLUDES = \
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/libnm-util

noinst_PROGRAMS = \
	test-settings-defaults \
	test-crypto \
	test-secrets \
	test-general \
	test-setting-8021x

test_settings_defaults_SOURCES = \
	test-settings-defaults.c

test_settings_defaults_CPPFLAGS = \
	$(GLIB_CFLAGS) \
	$(DBUS_CFLAGS)

test_settings_defaults_LDADD = \
	$(top_builddir)/libnm-util/libnm-util.la \
	$(GLIB_LIBS) \
	$(DBUS_LIBS)

test_crypto_SOURCES = \
	test-crypto.c

test_crypto_CPPFLAGS = \
	$(GLIB_CFLAGS)

test_crypto_LDADD = \
	$(top_builddir)/libnm-util/libtest-crypto.la \
	$(top_builddir)/libnm-util/libnm-util.la \
	$(GLIB_LIBS)

test_secrets_SOURCES = \
	test-secrets.c

test_secrets_CPPFLAGS = \
	-DTEST_CERT_DIR=\"$(top_srcdir)/libnm-util/tests/certs/\" \
	$(GLIB_CFLAGS) \
	$(DBUS_CFLAGS)

test_secrets_LDADD = \
	$(top_builddir)/libnm-util/libnm-util.la \
	$(GLIB_LIBS) \
	$(DBUS_LIBS)

test_general_SOURCES = \
	test-general.c

test_general_CPPFLAGS = \
	$(GLIB_CFLAGS) \
	$(DBUS_CFLAGS)

test_general_LDADD = \
	$(top_builddir)/libnm-util/libnm-util.la \
	$(GLIB_LIBS) \
	$(DBUS_LIBS)

test_setting_8021x_SOURCES = \
	test-setting-8021x.c

test_setting_8021x_CPPFLAGS = \
	$(GLIB_CFLAGS) \
	$(DBUS_CFLAGS)

test_setting_8021x_LDADD = \
	$(top_builddir)/libnm-util/libnm-util.la \
	$(GLIB_LIBS) \
	$(DBUS_LIBS)

if WITH_TESTS

check-local: test-settings-defaults test-crypto test-secrets
	$(abs_builddir)/test-settings-defaults
	$(abs_builddir)/test-secrets
	$(abs_builddir)/test-general

# Private key and CA certificate in the same file (PEM)
	$(abs_builddir)/test-setting-8021x $(srcdir)/certs/test_key_and_cert.pem "test"

# Private key by itself (PEM)
	$(abs_builddir)/test-setting-8021x $(srcdir)/certs/test-key-only.pem "test"

# Private key and CA certificate in the same file (pkcs12)
	$(abs_builddir)/test-setting-8021x $(srcdir)/certs/test-cert.p12 "test"

# Normal CA certificate
	$(abs_builddir)/test-crypto --cert $(srcdir)/certs/test_ca_cert.pem

# Another CA certificate
	$(abs_builddir)/test-crypto --cert $(srcdir)/certs/test2_ca_cert.pem

# CA certificate without an ending newline
	$(abs_builddir)/test-crypto --cert $(srcdir)/certs/ca-no-ending-newline.pem

# Combined user cert and private key
	$(abs_builddir)/test-crypto --cert $(srcdir)/certs/test_key_and_cert.pem

# Another combined user cert and private key
	$(abs_builddir)/test-crypto --cert $(srcdir)/certs/test2_key_and_cert.pem

# Private key with 8 bytes of tail padding
	$(abs_builddir)/test-crypto --key \
		$(srcdir)/certs/test_key_and_cert.pem \
		"test" \
		$(srcdir)/certs/test-key-only-decrypted.der

# Private key only (not combined with a cert)
	$(abs_builddir)/test-crypto --key \
		$(srcdir)/certs/test-key-only.pem \
		"test" \
		$(srcdir)/certs/test-key-only-decrypted.der

# Private key with 6 bytes of tail padding
	$(abs_builddir)/test-crypto --key $(srcdir)/certs/test2_key_and_cert.pem "12345testing"

# PKCS#12 file
	$(abs_builddir)/test-crypto --p12 $(srcdir)/certs/test-cert.p12 "test"

# Another PKCS#12 file
	$(abs_builddir)/test-crypto --p12 $(srcdir)/certs/test2-cert.p12 "12345testing"

endif