diff options
Diffstat (limited to 'src/platform/tests')
| -rw-r--r-- | src/platform/tests/Makefile.am | 16 | ||||
| -rw-r--r-- | src/platform/tests/Makefile.in | 216 | ||||
| -rw-r--r-- | src/platform/tests/test-address.c | 46 | ||||
| -rw-r--r-- | src/platform/tests/test-cleanup.c | 4 | ||||
| -rw-r--r-- | src/platform/tests/test-common.c | 570 | ||||
| -rw-r--r-- | src/platform/tests/test-common.h | 105 | ||||
| -rw-r--r-- | src/platform/tests/test-general.c | 4 | ||||
| -rw-r--r-- | src/platform/tests/test-link.c | 66 | ||||
| -rw-r--r-- | src/platform/tests/test-route.c | 46 |
9 files changed, 596 insertions, 477 deletions
diff --git a/src/platform/tests/Makefile.am b/src/platform/tests/Makefile.am index ebf20e15..5af4ce91 100644 --- a/src/platform/tests/Makefile.am +++ b/src/platform/tests/Makefile.am @@ -50,56 +50,56 @@ EXTRA_DIST = test-common.h monitor_SOURCES = monitor.c $(PLATFORM_SOURCES) monitor_LDADD = $(PLATFORM_LDADD) -test_link_fake_SOURCES = test-link.c $(TEST_SOURCES) +test_link_fake_SOURCES = $(TEST_SOURCES) test-link.c test_link_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_link_fake_LDADD = $(PLATFORM_LDADD) -test_link_linux_SOURCES = test-link.c $(TEST_SOURCES) +test_link_linux_SOURCES = $(TEST_SOURCES) test-link.c test_link_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_link_linux_LDADD = $(PLATFORM_LDADD) -test_address_fake_SOURCES = test-address.c $(TEST_SOURCES) +test_address_fake_SOURCES = $(TEST_SOURCES) test-address.c test_address_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_address_fake_LDADD = $(PLATFORM_LDADD) -test_address_linux_SOURCES = test-address.c $(TEST_SOURCES) +test_address_linux_SOURCES = $(TEST_SOURCES) test-address.c test_address_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_address_linux_LDADD = $(PLATFORM_LDADD) -test_route_fake_SOURCES = test-route.c $(TEST_SOURCES) +test_route_fake_SOURCES = $(TEST_SOURCES) test-route.c test_route_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_route_fake_LDADD = $(PLATFORM_LDADD) -test_route_linux_SOURCES = test-route.c $(TEST_SOURCES) +test_route_linux_SOURCES = $(TEST_SOURCES) test-route.c test_route_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_route_linux_LDADD = $(PLATFORM_LDADD) -test_cleanup_fake_SOURCES = test-cleanup.c $(TEST_SOURCES) +test_cleanup_fake_SOURCES = $(TEST_SOURCES) test-cleanup.c test_cleanup_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_cleanup_fake_LDADD = $(PLATFORM_LDADD) -test_cleanup_linux_SOURCES = test-cleanup.c $(TEST_SOURCES) +test_cleanup_linux_SOURCES = $(TEST_SOURCES) test-cleanup.c test_cleanup_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ diff --git a/src/platform/tests/Makefile.in b/src/platform/tests/Makefile.in index 7c4b72ea..60cd6d82 100644 --- a/src/platform/tests/Makefile.in +++ b/src/platform/tests/Makefile.in @@ -137,8 +137,8 @@ am__objects_2 = test_address_fake-nm-platform.$(OBJEXT) \ test_address_fake-nm-linux-platform.$(OBJEXT) am__objects_3 = test_address_fake-test-common.$(OBJEXT) \ $(am__objects_2) -am_test_address_fake_OBJECTS = \ - test_address_fake-test-address.$(OBJEXT) $(am__objects_3) +am_test_address_fake_OBJECTS = $(am__objects_3) \ + test_address_fake-test-address.$(OBJEXT) test_address_fake_OBJECTS = $(am_test_address_fake_OBJECTS) test_address_fake_DEPENDENCIES = $(PLATFORM_LDADD) am__objects_4 = test_address_linux-nm-platform.$(OBJEXT) \ @@ -146,8 +146,8 @@ am__objects_4 = test_address_linux-nm-platform.$(OBJEXT) \ test_address_linux-nm-linux-platform.$(OBJEXT) am__objects_5 = test_address_linux-test-common.$(OBJEXT) \ $(am__objects_4) -am_test_address_linux_OBJECTS = \ - test_address_linux-test-address.$(OBJEXT) $(am__objects_5) +am_test_address_linux_OBJECTS = $(am__objects_5) \ + test_address_linux-test-address.$(OBJEXT) test_address_linux_OBJECTS = $(am_test_address_linux_OBJECTS) test_address_linux_DEPENDENCIES = $(PLATFORM_LDADD) am__objects_6 = test_cleanup_fake-nm-platform.$(OBJEXT) \ @@ -155,8 +155,8 @@ am__objects_6 = test_cleanup_fake-nm-platform.$(OBJEXT) \ test_cleanup_fake-nm-linux-platform.$(OBJEXT) am__objects_7 = test_cleanup_fake-test-common.$(OBJEXT) \ $(am__objects_6) -am_test_cleanup_fake_OBJECTS = \ - test_cleanup_fake-test-cleanup.$(OBJEXT) $(am__objects_7) +am_test_cleanup_fake_OBJECTS = $(am__objects_7) \ + test_cleanup_fake-test-cleanup.$(OBJEXT) test_cleanup_fake_OBJECTS = $(am_test_cleanup_fake_OBJECTS) test_cleanup_fake_DEPENDENCIES = $(PLATFORM_LDADD) am__objects_8 = test_cleanup_linux-nm-platform.$(OBJEXT) \ @@ -164,8 +164,8 @@ am__objects_8 = test_cleanup_linux-nm-platform.$(OBJEXT) \ test_cleanup_linux-nm-linux-platform.$(OBJEXT) am__objects_9 = test_cleanup_linux-test-common.$(OBJEXT) \ $(am__objects_8) -am_test_cleanup_linux_OBJECTS = \ - test_cleanup_linux-test-cleanup.$(OBJEXT) $(am__objects_9) +am_test_cleanup_linux_OBJECTS = $(am__objects_9) \ + test_cleanup_linux-test-cleanup.$(OBJEXT) test_cleanup_linux_OBJECTS = $(am_test_cleanup_linux_OBJECTS) test_cleanup_linux_DEPENDENCIES = $(PLATFORM_LDADD) am_test_general_OBJECTS = test-general.$(OBJEXT) @@ -176,8 +176,8 @@ am__objects_10 = test_link_fake-nm-platform.$(OBJEXT) \ test_link_fake-nm-linux-platform.$(OBJEXT) am__objects_11 = test_link_fake-test-common.$(OBJEXT) \ $(am__objects_10) -am_test_link_fake_OBJECTS = test_link_fake-test-link.$(OBJEXT) \ - $(am__objects_11) +am_test_link_fake_OBJECTS = $(am__objects_11) \ + test_link_fake-test-link.$(OBJEXT) test_link_fake_OBJECTS = $(am_test_link_fake_OBJECTS) test_link_fake_DEPENDENCIES = $(PLATFORM_LDADD) am__objects_12 = test_link_linux-nm-platform.$(OBJEXT) \ @@ -185,8 +185,8 @@ am__objects_12 = test_link_linux-nm-platform.$(OBJEXT) \ test_link_linux-nm-linux-platform.$(OBJEXT) am__objects_13 = test_link_linux-test-common.$(OBJEXT) \ $(am__objects_12) -am_test_link_linux_OBJECTS = test_link_linux-test-link.$(OBJEXT) \ - $(am__objects_13) +am_test_link_linux_OBJECTS = $(am__objects_13) \ + test_link_linux-test-link.$(OBJEXT) test_link_linux_OBJECTS = $(am_test_link_linux_OBJECTS) test_link_linux_DEPENDENCIES = $(PLATFORM_LDADD) am_test_nmp_object_OBJECTS = test-nmp-object.$(OBJEXT) @@ -198,8 +198,8 @@ am__objects_14 = test_route_fake-nm-platform.$(OBJEXT) \ test_route_fake-nm-linux-platform.$(OBJEXT) am__objects_15 = test_route_fake-test-common.$(OBJEXT) \ $(am__objects_14) -am_test_route_fake_OBJECTS = test_route_fake-test-route.$(OBJEXT) \ - $(am__objects_15) +am_test_route_fake_OBJECTS = $(am__objects_15) \ + test_route_fake-test-route.$(OBJEXT) test_route_fake_OBJECTS = $(am_test_route_fake_OBJECTS) test_route_fake_DEPENDENCIES = $(PLATFORM_LDADD) am__objects_16 = test_route_linux-nm-platform.$(OBJEXT) \ @@ -207,8 +207,8 @@ am__objects_16 = test_route_linux-nm-platform.$(OBJEXT) \ test_route_linux-nm-linux-platform.$(OBJEXT) am__objects_17 = test_route_linux-test-common.$(OBJEXT) \ $(am__objects_16) -am_test_route_linux_OBJECTS = test_route_linux-test-route.$(OBJEXT) \ - $(am__objects_17) +am_test_route_linux_OBJECTS = $(am__objects_17) \ + test_route_linux-test-route.$(OBJEXT) test_route_linux_OBJECTS = $(am_test_route_linux_OBJECTS) test_route_linux_DEPENDENCIES = $(PLATFORM_LDADD) AM_V_P = $(am__v_P_@AM_V@) @@ -776,56 +776,56 @@ PLATFORM_LDADD = \ EXTRA_DIST = test-common.h monitor_SOURCES = monitor.c $(PLATFORM_SOURCES) monitor_LDADD = $(PLATFORM_LDADD) -test_link_fake_SOURCES = test-link.c $(TEST_SOURCES) +test_link_fake_SOURCES = $(TEST_SOURCES) test-link.c test_link_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_link_fake_LDADD = $(PLATFORM_LDADD) -test_link_linux_SOURCES = test-link.c $(TEST_SOURCES) +test_link_linux_SOURCES = $(TEST_SOURCES) test-link.c test_link_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_link_linux_LDADD = $(PLATFORM_LDADD) -test_address_fake_SOURCES = test-address.c $(TEST_SOURCES) +test_address_fake_SOURCES = $(TEST_SOURCES) test-address.c test_address_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_address_fake_LDADD = $(PLATFORM_LDADD) -test_address_linux_SOURCES = test-address.c $(TEST_SOURCES) +test_address_linux_SOURCES = $(TEST_SOURCES) test-address.c test_address_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_address_linux_LDADD = $(PLATFORM_LDADD) -test_route_fake_SOURCES = test-route.c $(TEST_SOURCES) +test_route_fake_SOURCES = $(TEST_SOURCES) test-route.c test_route_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_route_fake_LDADD = $(PLATFORM_LDADD) -test_route_linux_SOURCES = test-route.c $(TEST_SOURCES) +test_route_linux_SOURCES = $(TEST_SOURCES) test-route.c test_route_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ -DKERNEL_HACKS=1 test_route_linux_LDADD = $(PLATFORM_LDADD) -test_cleanup_fake_SOURCES = test-cleanup.c $(TEST_SOURCES) +test_cleanup_fake_SOURCES = $(TEST_SOURCES) test-cleanup.c test_cleanup_fake_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_fake_platform_setup \ -DKERNEL_HACKS=0 test_cleanup_fake_LDADD = $(PLATFORM_LDADD) -test_cleanup_linux_SOURCES = test-cleanup.c $(TEST_SOURCES) +test_cleanup_linux_SOURCES = $(TEST_SOURCES) test-cleanup.c test_cleanup_linux_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSETUP=nm_linux_platform_setup \ @@ -1047,20 +1047,6 @@ nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_address_fake-test-address.o: test-address.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_fake-test-address.o -MD -MP -MF $(DEPDIR)/test_address_fake-test-address.Tpo -c -o test_address_fake-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_fake-test-address.Tpo $(DEPDIR)/test_address_fake-test-address.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_fake-test-address.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_fake-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c - -test_address_fake-test-address.obj: test-address.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_fake-test-address.obj -MD -MP -MF $(DEPDIR)/test_address_fake-test-address.Tpo -c -o test_address_fake-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_fake-test-address.Tpo $(DEPDIR)/test_address_fake-test-address.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_fake-test-address.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_fake-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` - test_address_fake-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_fake-test-common.o -MD -MP -MF $(DEPDIR)/test_address_fake-test-common.Tpo -c -o test_address_fake-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_fake-test-common.Tpo $(DEPDIR)/test_address_fake-test-common.Po @@ -1117,19 +1103,19 @@ test_address_fake-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_fake-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_address_linux-test-address.o: test-address.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_linux-test-address.o -MD -MP -MF $(DEPDIR)/test_address_linux-test-address.Tpo -c -o test_address_linux-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_linux-test-address.Tpo $(DEPDIR)/test_address_linux-test-address.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_linux-test-address.o' libtool=no @AMDEPBACKSLASH@ +test_address_fake-test-address.o: test-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_fake-test-address.o -MD -MP -MF $(DEPDIR)/test_address_fake-test-address.Tpo -c -o test_address_fake-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_fake-test-address.Tpo $(DEPDIR)/test_address_fake-test-address.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_fake-test-address.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_linux-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_fake-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c -test_address_linux-test-address.obj: test-address.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_linux-test-address.obj -MD -MP -MF $(DEPDIR)/test_address_linux-test-address.Tpo -c -o test_address_linux-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_linux-test-address.Tpo $(DEPDIR)/test_address_linux-test-address.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_linux-test-address.obj' libtool=no @AMDEPBACKSLASH@ +test_address_fake-test-address.obj: test-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_fake-test-address.obj -MD -MP -MF $(DEPDIR)/test_address_fake-test-address.Tpo -c -o test_address_fake-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_fake-test-address.Tpo $(DEPDIR)/test_address_fake-test-address.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_fake-test-address.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_linux-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_fake-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` test_address_linux-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_linux-test-common.o -MD -MP -MF $(DEPDIR)/test_address_linux-test-common.Tpo -c -o test_address_linux-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1187,19 +1173,19 @@ test_address_linux-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_linux-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_cleanup_fake-test-cleanup.o: test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_fake-test-cleanup.o -MD -MP -MF $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo -c -o test_cleanup_fake-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo $(DEPDIR)/test_cleanup_fake-test-cleanup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_fake-test-cleanup.o' libtool=no @AMDEPBACKSLASH@ +test_address_linux-test-address.o: test-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_linux-test-address.o -MD -MP -MF $(DEPDIR)/test_address_linux-test-address.Tpo -c -o test_address_linux-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_linux-test-address.Tpo $(DEPDIR)/test_address_linux-test-address.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_linux-test-address.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_fake-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_linux-test-address.o `test -f 'test-address.c' || echo '$(srcdir)/'`test-address.c -test_cleanup_fake-test-cleanup.obj: test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_fake-test-cleanup.obj -MD -MP -MF $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo -c -o test_cleanup_fake-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo $(DEPDIR)/test_cleanup_fake-test-cleanup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_fake-test-cleanup.obj' libtool=no @AMDEPBACKSLASH@ +test_address_linux-test-address.obj: test-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_address_linux-test-address.obj -MD -MP -MF $(DEPDIR)/test_address_linux-test-address.Tpo -c -o test_address_linux-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_address_linux-test-address.Tpo $(DEPDIR)/test_address_linux-test-address.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-address.c' object='test_address_linux-test-address.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_fake-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_address_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_address_linux-test-address.obj `if test -f 'test-address.c'; then $(CYGPATH_W) 'test-address.c'; else $(CYGPATH_W) '$(srcdir)/test-address.c'; fi` test_cleanup_fake-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_fake-test-common.o -MD -MP -MF $(DEPDIR)/test_cleanup_fake-test-common.Tpo -c -o test_cleanup_fake-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1257,19 +1243,19 @@ test_cleanup_fake-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_fake-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_cleanup_linux-test-cleanup.o: test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_linux-test-cleanup.o -MD -MP -MF $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo -c -o test_cleanup_linux-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo $(DEPDIR)/test_cleanup_linux-test-cleanup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_linux-test-cleanup.o' libtool=no @AMDEPBACKSLASH@ +test_cleanup_fake-test-cleanup.o: test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_fake-test-cleanup.o -MD -MP -MF $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo -c -o test_cleanup_fake-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo $(DEPDIR)/test_cleanup_fake-test-cleanup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_fake-test-cleanup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_linux-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_fake-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c -test_cleanup_linux-test-cleanup.obj: test-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_linux-test-cleanup.obj -MD -MP -MF $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo -c -o test_cleanup_linux-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo $(DEPDIR)/test_cleanup_linux-test-cleanup.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_linux-test-cleanup.obj' libtool=no @AMDEPBACKSLASH@ +test_cleanup_fake-test-cleanup.obj: test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_fake-test-cleanup.obj -MD -MP -MF $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo -c -o test_cleanup_fake-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_fake-test-cleanup.Tpo $(DEPDIR)/test_cleanup_fake-test-cleanup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_fake-test-cleanup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_linux-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_fake-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` test_cleanup_linux-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_linux-test-common.o -MD -MP -MF $(DEPDIR)/test_cleanup_linux-test-common.Tpo -c -o test_cleanup_linux-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1327,19 +1313,19 @@ test_cleanup_linux-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_linux-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_link_fake-test-link.o: test-link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_fake-test-link.o -MD -MP -MF $(DEPDIR)/test_link_fake-test-link.Tpo -c -o test_link_fake-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_fake-test-link.Tpo $(DEPDIR)/test_link_fake-test-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_fake-test-link.o' libtool=no @AMDEPBACKSLASH@ +test_cleanup_linux-test-cleanup.o: test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_linux-test-cleanup.o -MD -MP -MF $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo -c -o test_cleanup_linux-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo $(DEPDIR)/test_cleanup_linux-test-cleanup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_linux-test-cleanup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_fake-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_linux-test-cleanup.o `test -f 'test-cleanup.c' || echo '$(srcdir)/'`test-cleanup.c -test_link_fake-test-link.obj: test-link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_fake-test-link.obj -MD -MP -MF $(DEPDIR)/test_link_fake-test-link.Tpo -c -o test_link_fake-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_fake-test-link.Tpo $(DEPDIR)/test_link_fake-test-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_fake-test-link.obj' libtool=no @AMDEPBACKSLASH@ +test_cleanup_linux-test-cleanup.obj: test-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cleanup_linux-test-cleanup.obj -MD -MP -MF $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo -c -o test_cleanup_linux-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cleanup_linux-test-cleanup.Tpo $(DEPDIR)/test_cleanup_linux-test-cleanup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-cleanup.c' object='test_cleanup_linux-test-cleanup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_fake-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_cleanup_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cleanup_linux-test-cleanup.obj `if test -f 'test-cleanup.c'; then $(CYGPATH_W) 'test-cleanup.c'; else $(CYGPATH_W) '$(srcdir)/test-cleanup.c'; fi` test_link_fake-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_fake-test-common.o -MD -MP -MF $(DEPDIR)/test_link_fake-test-common.Tpo -c -o test_link_fake-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1397,19 +1383,19 @@ test_link_fake-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_fake-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_link_linux-test-link.o: test-link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_linux-test-link.o -MD -MP -MF $(DEPDIR)/test_link_linux-test-link.Tpo -c -o test_link_linux-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_linux-test-link.Tpo $(DEPDIR)/test_link_linux-test-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_linux-test-link.o' libtool=no @AMDEPBACKSLASH@ +test_link_fake-test-link.o: test-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_fake-test-link.o -MD -MP -MF $(DEPDIR)/test_link_fake-test-link.Tpo -c -o test_link_fake-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_fake-test-link.Tpo $(DEPDIR)/test_link_fake-test-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_fake-test-link.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_linux-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_fake-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c -test_link_linux-test-link.obj: test-link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_linux-test-link.obj -MD -MP -MF $(DEPDIR)/test_link_linux-test-link.Tpo -c -o test_link_linux-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_linux-test-link.Tpo $(DEPDIR)/test_link_linux-test-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_linux-test-link.obj' libtool=no @AMDEPBACKSLASH@ +test_link_fake-test-link.obj: test-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_fake-test-link.obj -MD -MP -MF $(DEPDIR)/test_link_fake-test-link.Tpo -c -o test_link_fake-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_fake-test-link.Tpo $(DEPDIR)/test_link_fake-test-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_fake-test-link.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_linux-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_fake-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` test_link_linux-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_linux-test-common.o -MD -MP -MF $(DEPDIR)/test_link_linux-test-common.Tpo -c -o test_link_linux-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1467,19 +1453,19 @@ test_link_linux-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_linux-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_route_fake-test-route.o: test-route.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_fake-test-route.o -MD -MP -MF $(DEPDIR)/test_route_fake-test-route.Tpo -c -o test_route_fake-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_fake-test-route.Tpo $(DEPDIR)/test_route_fake-test-route.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_fake-test-route.o' libtool=no @AMDEPBACKSLASH@ +test_link_linux-test-link.o: test-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_linux-test-link.o -MD -MP -MF $(DEPDIR)/test_link_linux-test-link.Tpo -c -o test_link_linux-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_linux-test-link.Tpo $(DEPDIR)/test_link_linux-test-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_linux-test-link.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_fake-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_linux-test-link.o `test -f 'test-link.c' || echo '$(srcdir)/'`test-link.c -test_route_fake-test-route.obj: test-route.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_fake-test-route.obj -MD -MP -MF $(DEPDIR)/test_route_fake-test-route.Tpo -c -o test_route_fake-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_fake-test-route.Tpo $(DEPDIR)/test_route_fake-test-route.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_fake-test-route.obj' libtool=no @AMDEPBACKSLASH@ +test_link_linux-test-link.obj: test-link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_link_linux-test-link.obj -MD -MP -MF $(DEPDIR)/test_link_linux-test-link.Tpo -c -o test_link_linux-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_link_linux-test-link.Tpo $(DEPDIR)/test_link_linux-test-link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-link.c' object='test_link_linux-test-link.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_fake-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_link_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_link_linux-test-link.obj `if test -f 'test-link.c'; then $(CYGPATH_W) 'test-link.c'; else $(CYGPATH_W) '$(srcdir)/test-link.c'; fi` test_route_fake-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_fake-test-common.o -MD -MP -MF $(DEPDIR)/test_route_fake-test-common.Tpo -c -o test_route_fake-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1537,19 +1523,19 @@ test_route_fake-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_fake-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` -test_route_linux-test-route.o: test-route.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_linux-test-route.o -MD -MP -MF $(DEPDIR)/test_route_linux-test-route.Tpo -c -o test_route_linux-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_linux-test-route.Tpo $(DEPDIR)/test_route_linux-test-route.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_linux-test-route.o' libtool=no @AMDEPBACKSLASH@ +test_route_fake-test-route.o: test-route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_fake-test-route.o -MD -MP -MF $(DEPDIR)/test_route_fake-test-route.Tpo -c -o test_route_fake-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_fake-test-route.Tpo $(DEPDIR)/test_route_fake-test-route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_fake-test-route.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_linux-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_fake-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c -test_route_linux-test-route.obj: test-route.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_linux-test-route.obj -MD -MP -MF $(DEPDIR)/test_route_linux-test-route.Tpo -c -o test_route_linux-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_linux-test-route.Tpo $(DEPDIR)/test_route_linux-test-route.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_linux-test-route.obj' libtool=no @AMDEPBACKSLASH@ +test_route_fake-test-route.obj: test-route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_fake-test-route.obj -MD -MP -MF $(DEPDIR)/test_route_fake-test-route.Tpo -c -o test_route_fake-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_fake-test-route.Tpo $(DEPDIR)/test_route_fake-test-route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_fake-test-route.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_linux-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_fake_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_fake-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` test_route_linux-test-common.o: test-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_linux-test-common.o -MD -MP -MF $(DEPDIR)/test_route_linux-test-common.Tpo -c -o test_route_linux-test-common.o `test -f 'test-common.c' || echo '$(srcdir)/'`test-common.c @@ -1607,6 +1593,20 @@ test_route_linux-nm-linux-platform.obj: ../nm-linux-platform.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_linux-nm-linux-platform.obj `if test -f '../nm-linux-platform.c'; then $(CYGPATH_W) '../nm-linux-platform.c'; else $(CYGPATH_W) '$(srcdir)/../nm-linux-platform.c'; fi` +test_route_linux-test-route.o: test-route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_linux-test-route.o -MD -MP -MF $(DEPDIR)/test_route_linux-test-route.Tpo -c -o test_route_linux-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_linux-test-route.Tpo $(DEPDIR)/test_route_linux-test-route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_linux-test-route.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_linux-test-route.o `test -f 'test-route.c' || echo '$(srcdir)/'`test-route.c + +test_route_linux-test-route.obj: test-route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_route_linux-test-route.obj -MD -MP -MF $(DEPDIR)/test_route_linux-test-route.Tpo -c -o test_route_linux-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_route_linux-test-route.Tpo $(DEPDIR)/test_route_linux-test-route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-route.c' object='test_route_linux-test-route.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_route_linux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_route_linux-test-route.obj `if test -f 'test-route.c'; then $(CYGPATH_W) 'test-route.c'; else $(CYGPATH_W) '$(srcdir)/test-route.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c index 83a0bfd3..05a14448 100644 --- a/src/platform/tests/test-address.c +++ b/src/platform/tests/test-address.c @@ -94,12 +94,12 @@ test_ip4_address_general (void) /* Add address */ g_assert (!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); accept_signal (address_added); /* Add address again (aka update) */ - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr, lifetime + 100, preferred + 50, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr, lifetime + 100, preferred + 50, 0, NULL); accept_signals (address_changed, 0, 1); /* Test address listing */ @@ -114,12 +114,12 @@ test_ip4_address_general (void) g_array_unref (addresses); /* Remove address */ - nmtstp_ip4_address_del (EX, ifindex, addr, IP4_PLEN, addr); + nmtstp_ip4_address_del (NULL, EX, ifindex, addr, IP4_PLEN, addr); g_assert (!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); accept_signal (address_removed); /* Remove address again */ - nmtstp_ip4_address_del (EX, ifindex, addr, IP4_PLEN, addr); + nmtstp_ip4_address_del (NULL, EX, ifindex, addr, IP4_PLEN, addr); free_signal (address_added); free_signal (address_changed); @@ -144,12 +144,12 @@ test_ip6_address_general (void) /* Add address */ g_assert (!nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); - nmtstp_ip6_address_add (EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); + nmtstp_ip6_address_add (NULL, EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); g_assert (nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); accept_signal (address_added); /* Add address again (aka update) */ - nmtstp_ip6_address_add (EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); + nmtstp_ip6_address_add (NULL, EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); accept_signals (address_changed, 0, 1); /* Test address listing */ @@ -163,12 +163,12 @@ test_ip6_address_general (void) g_array_unref (addresses); /* Remove address */ - nmtstp_ip6_address_del (EX, ifindex, addr, IP6_PLEN); + nmtstp_ip6_address_del (NULL, EX, ifindex, addr, IP6_PLEN); g_assert (!nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); accept_signal (address_removed); /* Remove address again */ - nmtstp_ip6_address_del (EX, ifindex, addr, IP6_PLEN); + nmtstp_ip6_address_del (NULL, EX, ifindex, addr, IP6_PLEN); /* ensure not pending signal. */ accept_signals (address_changed, 0, 1); @@ -197,15 +197,15 @@ test_ip4_address_general_2 (void) g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, DEVICE_IFINDEX, NULL)); /* Add/delete notification */ - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); accept_signal (address_added); g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); - nmtstp_ip4_address_del (EX, ifindex, addr, IP4_PLEN, addr); + nmtstp_ip4_address_del (NULL, EX, ifindex, addr, IP4_PLEN, addr); accept_signal (address_removed); g_assert (!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); /* Add/delete conflict */ - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL); g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr)); accept_signal (address_added); @@ -227,20 +227,20 @@ test_ip6_address_general_2 (void) inet_pton (AF_INET6, IP6_ADDRESS, &addr); /* Add/delete notification */ - nmtstp_ip6_address_add (EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, 0); + nmtstp_ip6_address_add (NULL, EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, 0); accept_signal (address_added); g_assert (nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); - nmtstp_ip6_address_del (EX, ifindex, addr, IP6_PLEN); + nmtstp_ip6_address_del (NULL, EX, ifindex, addr, IP6_PLEN); accept_signal (address_removed); g_assert (!nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); /* Add/delete conflict */ - nmtstp_ip6_address_add (EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, 0); + nmtstp_ip6_address_add (NULL, EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, 0); accept_signal (address_added); g_assert (nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); - nmtstp_ip6_address_add (EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); + nmtstp_ip6_address_add (NULL, EX, ifindex, addr, IP6_PLEN, in6addr_any, lifetime, preferred, flags); ensure_no_signal (address_added); g_assert (nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, addr, IP6_PLEN)); @@ -273,7 +273,7 @@ test_ip4_address_peer (void) accept_signals (address_added, 0, G_MAXINT); /* Add/delete notification */ - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr_peer, lifetime, preferred, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr_peer, lifetime, preferred, 0, NULL); accept_signal (address_added); a = nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr_peer); g_assert (a); @@ -281,7 +281,7 @@ test_ip4_address_peer (void) nmtstp_ip_address_assert_lifetime ((NMPlatformIPAddress *) a, -1, lifetime, preferred); - nmtstp_ip4_address_add (EX, ifindex, addr, IP4_PLEN, addr_peer2, lifetime, preferred, 0, NULL); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, IP4_PLEN, addr_peer2, lifetime, preferred, 0, NULL); accept_signal (address_added); g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr_peer)); a = nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr_peer2); @@ -290,7 +290,7 @@ test_ip4_address_peer (void) nmtstp_ip_address_assert_lifetime ((NMPlatformIPAddress *) a, -1, lifetime, preferred); g_assert (addr != addr_peer); - nmtstp_ip4_address_del (EX, ifindex, addr, IP4_PLEN, addr_peer); + nmtstp_ip4_address_del (NULL, EX, ifindex, addr, IP4_PLEN, addr_peer); accept_signal (address_removed); g_assert (!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr_peer)); g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, IP4_PLEN, addr_peer2)); @@ -308,7 +308,7 @@ test_ip4_address_peer_zero (void) in_addr_t addr, addr_peer; guint32 lifetime = 2000; guint32 preferred = 1000; - const int plen = 24; + const gint8 plen = 24; const char *label = NULL; in_addr_t peers[3], r_peers[3]; int i; @@ -328,7 +328,7 @@ test_ip4_address_peer_zero (void) for (i = 0; i < G_N_ELEMENTS (peers); i++) { g_assert (!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, plen, r_peers[i])); - nmtstp_ip4_address_add (EX, ifindex, addr, plen, r_peers[i], lifetime, preferred, 0, label); + nmtstp_ip4_address_add (NULL, EX, ifindex, addr, plen, r_peers[i], lifetime, preferred, 0, label); addrs = nm_platform_ip4_address_get_all (NM_PLATFORM_GET, ifindex); g_assert (addrs); @@ -343,7 +343,7 @@ test_ip4_address_peer_zero (void) for (i = 0; i < G_N_ELEMENTS (peers); i++) { g_assert (nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, addr, plen, r_peers[i])); - nmtstp_ip4_address_del (EX, ifindex, addr, plen, r_peers[i]); + nmtstp_ip4_address_del (NULL, EX, ifindex, addr, plen, r_peers[i]); addrs = nm_platform_ip4_address_get_all (NM_PLATFORM_GET, ifindex); g_assert (addrs); @@ -355,7 +355,7 @@ test_ip4_address_peer_zero (void) /*****************************************************************************/ void -init_tests (int *argc, char ***argv) +_nmtstp_init_tests (int *argc, char ***argv) { nmtst_init_with_logging (argc, argv, NULL, "ALL"); } @@ -412,7 +412,7 @@ _g_test_add_func (const char *testpath, } void -setup_tests (void) +_nmtstp_setup_tests (void) { _g_test_add_func ("/address/ipv4/general", test_ip4_address_general); _g_test_add_func ("/address/ipv6/general", test_ip6_address_general); diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c index 4036daad..3b52487a 100644 --- a/src/platform/tests/test-cleanup.c +++ b/src/platform/tests/test-cleanup.c @@ -107,13 +107,13 @@ test_cleanup_internal (void) } void -init_tests (int *argc, char ***argv) +_nmtstp_init_tests (int *argc, char ***argv) { nmtst_init_with_logging (argc, argv, NULL, "ALL"); } void -setup_tests (void) +_nmtstp_setup_tests (void) { nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME)); g_assert (!nm_platform_link_get_by_ifname (NM_PLATFORM_GET, DEVICE_NAME)); diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c index e9fffe90..b1947a6d 100644 --- a/src/platform/tests/test-common.c +++ b/src/platform/tests/test-common.c @@ -27,11 +27,11 @@ #include "test-common.h" -#include "nm-test-utils.h" - #define SIGNAL_DATA_FMT "'%s-%s' ifindex %d%s%s%s (%d times received)" #define SIGNAL_DATA_ARG(data) (data)->name, nm_platform_signal_change_type_to_string ((data)->change_type), (data)->ifindex, (data)->ifname ? " ifname '" : "", (data)->ifname ? (data)->ifname : "", (data)->ifname ? "'" : "", (data)->received_count +/*****************************************************************************/ + gboolean nmtstp_is_root_test (void) { @@ -47,6 +47,20 @@ nmtstp_is_sysfs_writable (void) || (access ("/sys/devices", W_OK) == 0); } +static void +_init_platform (NMPlatform **platform, gboolean external_command) +{ + g_assert (platform); + if (!*platform) + *platform = NM_PLATFORM_GET; + g_assert (NM_IS_PLATFORM (*platform)); + + if (external_command) + g_assert (NM_IS_LINUX_PLATFORM (*platform)); +} + +/*****************************************************************************/ + SignalData * add_signal_full (const char *name, NMPlatformSignalChangeType change_type, GCallback callback, int ifindex, const char *ifname) { @@ -180,8 +194,10 @@ link_callback (NMPlatform *platform, NMPObjectType obj_type, int ifindex, NMPlat g_error ("Added/changed link not found in the local cache."); } +/*****************************************************************************/ + gboolean -ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric) +nmtstp_ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric) { gs_free char *arg_network = NULL; const char *argv[] = { @@ -205,7 +221,7 @@ ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric) g_assert (!strstr (ifname, " metric ")); g_assert (plen >= 0 && plen <= 32); - if (!NM_IS_LINUX_PLATFORM (nm_platform_get ())) { + if (!nmtstp_is_root_test ()) { /* If we don't test against linux-platform, we don't actually configure any * routes in the system. */ return -1; @@ -259,15 +275,17 @@ ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric) } void -_assert_ip4_route_exists (const char *file, guint line, const char *func, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric) +_nmtstp_assert_ip4_route_exists (const char *file, guint line, const char *func, NMPlatform *platform, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric) { int ifindex; gboolean exists_checked; + _init_platform (&platform, FALSE); + /* Check for existance of the route by spawning iproute2. Do this because platform * code might be entirely borked, but we expect ip-route to give a correct result. * If the ip command cannot be found, we accept this as success. */ - exists_checked = ip4_route_exists (ifname, network, plen, metric); + exists_checked = nmtstp_ip4_route_exists (ifname, network, plen, metric); if (exists_checked != -1 && !exists_checked != !exists) { g_error ("[%s:%u] %s(): We expect the ip4 route %s/%d metric %u %s, but it %s", file, line, func, @@ -276,9 +294,9 @@ _assert_ip4_route_exists (const char *file, guint line, const char *func, gboole exists ? "doesn't" : "does"); } - ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, ifname); + ifindex = nm_platform_link_get_ifindex (platform, ifname); g_assert (ifindex > 0); - if (!nm_platform_ip4_route_get (NM_PLATFORM_GET, ifindex, network, plen, metric) != !exists) { + if (!nm_platform_ip4_route_get (platform, ifindex, network, plen, metric) != !exists) { g_error ("[%s:%u] %s(): The ip4 route %s/%d metric %u %s, but platform thinks %s", file, line, func, nm_utils_inet4_ntop (network, NULL), plen, metric, @@ -287,6 +305,8 @@ _assert_ip4_route_exists (const char *file, guint line, const char *func, gboole } } +/*****************************************************************************/ + int nmtstp_run_command (const char *format, ...) { @@ -309,7 +329,7 @@ nmtstp_run_command (const char *format, ...) typedef struct { GMainLoop *loop; - gboolean timeout; + guint signal_counts; guint id; } WaitForSignalData; @@ -323,6 +343,8 @@ _wait_for_signal_cb (NMPlatform *platform, { WaitForSignalData *data = user_data; + data->signal_counts++; + nm_clear_g_source (&data->id); g_main_loop_quit (data->loop); } @@ -331,20 +353,19 @@ _wait_for_signal_timeout (gpointer user_data) { WaitForSignalData *data = user_data; - data->timeout = TRUE; + g_assert (data->id); data->id = 0; g_main_loop_quit (data->loop); return G_SOURCE_REMOVE; } -gboolean +guint nmtstp_wait_for_signal (NMPlatform *platform, guint timeout_ms) { WaitForSignalData data = { 0 }; gulong id_link, id_ip4_address, id_ip6_address, id_ip4_route, id_ip6_route; - if (!platform) - platform = NM_PLATFORM_GET; + _init_platform (&platform, FALSE); data.loop = g_main_loop_new (NULL, FALSE); @@ -359,33 +380,34 @@ nmtstp_wait_for_signal (NMPlatform *platform, guint timeout_ms) g_main_loop_run (data.loop); + g_assert (!data.id); g_assert (nm_clear_g_signal_handler (platform, &id_link)); g_assert (nm_clear_g_signal_handler (platform, &id_ip4_address)); g_assert (nm_clear_g_signal_handler (platform, &id_ip6_address)); g_assert (nm_clear_g_signal_handler (platform, &id_ip4_route)); g_assert (nm_clear_g_signal_handler (platform, &id_ip6_route)); - if (nm_clear_g_source (&data.id)) - g_assert (timeout_ms != 0 && !data.timeout); - g_clear_pointer (&data.loop, g_main_loop_unref); - return !data.timeout; + /* return the number of signals, or 0 if timeout was reached .*/ + return data.signal_counts; } -gboolean +guint nmtstp_wait_for_signal_until (NMPlatform *platform, gint64 until_ms) { gint64 now; + guint signal_counts; while (TRUE) { now = nm_utils_get_monotonic_timestamp_ms (); if (until_ms < now) - return FALSE; + return 0; - if (nmtstp_wait_for_signal (platform, MAX (1, until_ms - now))) - return TRUE; + signal_counts = nmtstp_wait_for_signal (platform, MAX (1, until_ms - now)); + if (signal_counts) + return signal_counts; } } @@ -401,10 +423,12 @@ nmtstp_wait_for_link_until (NMPlatform *platform, const char *ifname, NMLinkType const NMPlatformLink *plink; gint64 now; + _init_platform (&platform, FALSE); + while (TRUE) { now = nm_utils_get_monotonic_timestamp_ms (); - plink = nm_platform_link_get_by_ifname (platform ?: NM_PLATFORM_GET, ifname); + plink = nm_platform_link_get_by_ifname (platform, ifname); if ( plink && (expected_link_type == NM_LINK_TYPE_NONE || plink->type == expected_link_type)) return plink; @@ -432,6 +456,8 @@ nmtstp_assert_wait_for_link_until (NMPlatform *platform, const char *ifname, NML return plink; } +/*****************************************************************************/ + int nmtstp_run_command_check_external_global (void) { @@ -460,6 +486,8 @@ nmtstp_run_command_check_external (int external_command) return (nmtst_get_rand_int () % 2) == 0; } +/*****************************************************************************/ + #define CHECK_LIFETIME_MAX_DIFF 2 gboolean @@ -556,8 +584,11 @@ nmtstp_ip_address_assert_lifetime (const NMPlatformIPAddress *addr, g_assert (nmtstp_ip_address_check_lifetime (addr, n, expected_lifetime, expected_preferred)); } +/*****************************************************************************/ + static void -_ip_address_add (gboolean external_command, +_ip_address_add (NMPlatform *platform, + gboolean external_command, gboolean is_v4, int ifindex, const NMIPAddr *address, @@ -572,6 +603,8 @@ _ip_address_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { const char *ifname; gs_free char *s_valid = NULL; @@ -579,7 +612,7 @@ _ip_address_add (gboolean external_command, gs_free char *s_label = NULL; char b1[NM_UTILS_INET_ADDRSTRLEN], b2[NM_UTILS_INET_ADDRSTRLEN]; - ifname = nm_platform_link_get_name (NM_PLATFORM_GET, ifindex); + ifname = nm_platform_link_get_name (platform, ifindex); g_assert (ifname); if (lifetime != NM_PLATFORM_LIFETIME_PERMANENT) @@ -628,7 +661,7 @@ _ip_address_add (gboolean external_command, gboolean success; if (is_v4) { - success = nm_platform_ip4_address_add (NM_PLATFORM_GET, + success = nm_platform_ip4_address_add (platform, ifindex, address->addr4, plen, @@ -639,7 +672,7 @@ _ip_address_add (gboolean external_command, label); } else { g_assert (label == NULL); - success = nm_platform_ip6_address_add (NM_PLATFORM_GET, + success = nm_platform_ip6_address_add (platform, ifindex, address->addr6, plen, @@ -656,14 +689,14 @@ _ip_address_add (gboolean external_command, do { if (external_command) - nm_platform_process_events (NM_PLATFORM_GET); + nm_platform_process_events (platform); /* let's wait until we see the address as we added it. */ if (is_v4) { const NMPlatformIP4Address *a; g_assert (flags == 0); - a = nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, address->addr4, plen, peer_address->addr4); + a = nm_platform_ip4_address_get (platform, ifindex, address->addr4, plen, peer_address->addr4); if ( a && a->peer_address == peer_address->addr4 && nmtstp_ip_address_check_lifetime ((NMPlatformIPAddress*) a, -1, lifetime, preferred) @@ -675,7 +708,7 @@ _ip_address_add (gboolean external_command, g_assert (label == NULL); g_assert (flags == 0); - a = nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, address->addr6, plen); + a = nm_platform_ip6_address_get (platform, ifindex, address->addr6, plen); if ( a && !memcmp (nm_platform_ip6_address_get_peer (a), (IN6_IS_ADDR_UNSPECIFIED (&peer_address->addr6) || IN6_ARE_ADDR_EQUAL (&address->addr6, &peer_address->addr6)) @@ -688,10 +721,188 @@ _ip_address_add (gboolean external_command, /* for internal command, we expect not to reach this line.*/ g_assert (external_command); - g_assert (nmtstp_wait_for_signal_until (NM_PLATFORM_GET, end_time)); + nmtstp_assert_wait_for_signal_until (platform, end_time); + } while (TRUE); +} + +void +nmtstp_ip4_address_add (NMPlatform *platform, + gboolean external_command, + int ifindex, + in_addr_t address, + int plen, + in_addr_t peer_address, + guint32 lifetime, + guint32 preferred, + guint32 flags, + const char *label) +{ + _ip_address_add (platform, + external_command, + TRUE, + ifindex, + (NMIPAddr *) &address, + plen, + (NMIPAddr *) &peer_address, + lifetime, + preferred, + flags, + label); +} + +void +nmtstp_ip6_address_add (NMPlatform *platform, + gboolean external_command, + int ifindex, + struct in6_addr address, + int plen, + struct in6_addr peer_address, + guint32 lifetime, + guint32 preferred, + guint32 flags) +{ + _ip_address_add (platform, + external_command, + FALSE, + ifindex, + (NMIPAddr *) &address, + plen, + (NMIPAddr *) &peer_address, + lifetime, + preferred, + flags, + NULL); +} + +/*****************************************************************************/ + +static void +_ip_address_del (NMPlatform *platform, + gboolean external_command, + gboolean is_v4, + int ifindex, + const NMIPAddr *address, + int plen, + const NMIPAddr *peer_address) +{ + gint64 end_time; + + external_command = nmtstp_run_command_check_external (external_command); + + _init_platform (&platform, external_command); + + if (external_command) { + const char *ifname; + char b1[NM_UTILS_INET_ADDRSTRLEN], b2[NM_UTILS_INET_ADDRSTRLEN]; + int success; + gboolean had_address; + + ifname = nm_platform_link_get_name (platform, ifindex); + g_assert (ifname); + + /* let's wait until we see the address as we added it. */ + if (is_v4) + had_address = !!nm_platform_ip4_address_get (platform, ifindex, address->addr4, plen, peer_address->addr4); + else + had_address = !!nm_platform_ip6_address_get (platform, ifindex, address->addr6, plen); + + if (is_v4) { + success = nmtstp_run_command ("ip address delete %s%s%s/%d dev %s", + nm_utils_inet4_ntop (address->addr4, b1), + peer_address->addr4 != address->addr4 ? " peer " : "", + peer_address->addr4 != address->addr4 ? nm_utils_inet4_ntop (peer_address->addr4, b2) : "", + plen, + ifname); + } else { + g_assert (!peer_address); + success = nmtstp_run_command ("ip address delete %s/%d dev %s", + nm_utils_inet6_ntop (&address->addr6, b1), + plen, + ifname); + } + g_assert (success == 0 || !had_address); + } else { + gboolean success; + + if (is_v4) { + success = nm_platform_ip4_address_delete (platform, + ifindex, + address->addr4, + plen, + peer_address->addr4); + } else { + g_assert (!peer_address); + success = nm_platform_ip6_address_delete (platform, + ifindex, + address->addr6, + plen); + } + g_assert (success); + } + + /* Let's wait until we get the result */ + end_time = nm_utils_get_monotonic_timestamp_ms () + 250; + do { + if (external_command) + nm_platform_process_events (platform); + + /* let's wait until we see the address as we added it. */ + if (is_v4) { + const NMPlatformIP4Address *a; + + a = nm_platform_ip4_address_get (platform, ifindex, address->addr4, plen, peer_address->addr4); + if (!a) + break; + } else { + const NMPlatformIP6Address *a; + + a = nm_platform_ip6_address_get (platform, ifindex, address->addr6, plen); + if (!a) + break; + } + + /* for internal command, we expect not to reach this line.*/ + g_assert (external_command); + + nmtstp_assert_wait_for_signal_until (platform, end_time); } while (TRUE); } +void +nmtstp_ip4_address_del (NMPlatform *platform, + gboolean external_command, + int ifindex, + in_addr_t address, + int plen, + in_addr_t peer_address) +{ + _ip_address_del (platform, + external_command, + TRUE, + ifindex, + (NMIPAddr *) &address, + plen, + (NMIPAddr *) &peer_address); +} + +void +nmtstp_ip6_address_del (NMPlatform *platform, + gboolean external_command, + int ifindex, + struct in6_addr address, + int plen) +{ + _ip_address_del (platform, + external_command, + FALSE, + ifindex, + (NMIPAddr *) &address, + plen, + NULL); +} + +/*****************************************************************************/ + #define _assert_pllink(platform, success, pllink, name, type) \ G_STMT_START { \ const NMPlatformLink *_pllink = (pllink); \ @@ -706,7 +917,8 @@ _ip_address_add (gboolean external_command, } G_STMT_END const NMPlatformLink * -nmtstp_link_dummy_add (gboolean external_command, +nmtstp_link_dummy_add (NMPlatform *platform, + gboolean external_command, const char *name) { const NMPlatformLink *pllink = NULL; @@ -716,21 +928,24 @@ nmtstp_link_dummy_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { success = !nmtstp_run_command ("ip link add %s type dummy", name); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_DUMMY, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_DUMMY, 100); } else - success = nm_platform_link_dummy_add (NM_PLATFORM_GET, name, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_dummy_add (platform, name, &pllink) == NM_PLATFORM_ERROR_SUCCESS; g_assert (success); - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, NM_LINK_TYPE_DUMMY); + _assert_pllink (platform, success, pllink, name, NM_LINK_TYPE_DUMMY); return pllink; } const NMPlatformLink * -nmtstp_link_gre_add (gboolean external_command, +nmtstp_link_gre_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkGre *lnk) { @@ -742,11 +957,13 @@ nmtstp_link_gre_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { gs_free char *dev = NULL; if (lnk->parent_ifindex) - dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (NM_PLATFORM_GET, lnk->parent_ifindex)); + dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (platform, lnk->parent_ifindex)); success = !nmtstp_run_command ("ip tunnel add %s mode gre %s local %s remote %s ttl %u tos %02x %s", name, @@ -757,17 +974,18 @@ nmtstp_link_gre_add (gboolean external_command, lnk->tos, lnk->path_mtu_discovery ? "pmtudisc" : "nopmtudisc"); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_GRE, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_GRE, 100); } else - success = nm_platform_link_gre_add (NM_PLATFORM_GET, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_gre_add (platform, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, NM_LINK_TYPE_GRE); + _assert_pllink (platform, success, pllink, name, NM_LINK_TYPE_GRE); return pllink; } const NMPlatformLink * -nmtstp_link_ip6tnl_add (gboolean external_command, +nmtstp_link_ip6tnl_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkIp6Tnl *lnk) { @@ -779,12 +997,14 @@ nmtstp_link_ip6tnl_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { gs_free char *dev = NULL; const char *mode; if (lnk->parent_ifindex) - dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (NM_PLATFORM_GET, lnk->parent_ifindex)); + dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (platform, lnk->parent_ifindex)); switch (lnk->proto) { case IPPROTO_IPIP: @@ -808,17 +1028,18 @@ nmtstp_link_ip6tnl_add (gboolean external_command, lnk->encap_limit, lnk->flow_label); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_IP6TNL, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_IP6TNL, 100); } else - success = nm_platform_link_ip6tnl_add (NM_PLATFORM_GET, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_ip6tnl_add (platform, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, NM_LINK_TYPE_IP6TNL); + _assert_pllink (platform, success, pllink, name, NM_LINK_TYPE_IP6TNL); return pllink; } const NMPlatformLink * -nmtstp_link_ipip_add (gboolean external_command, +nmtstp_link_ipip_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkIpIp *lnk) { @@ -830,11 +1051,13 @@ nmtstp_link_ipip_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { gs_free char *dev = NULL; if (lnk->parent_ifindex) - dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (NM_PLATFORM_GET, lnk->parent_ifindex)); + dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (platform, lnk->parent_ifindex)); success = !nmtstp_run_command ("ip tunnel add %s mode ipip %s local %s remote %s ttl %u tos %02x %s", name, @@ -845,17 +1068,18 @@ nmtstp_link_ipip_add (gboolean external_command, lnk->tos, lnk->path_mtu_discovery ? "pmtudisc" : "nopmtudisc"); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_IPIP, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_IPIP, 100); } else - success = nm_platform_link_ipip_add (NM_PLATFORM_GET, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_ipip_add (platform, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, NM_LINK_TYPE_IPIP); + _assert_pllink (platform, success, pllink, name, NM_LINK_TYPE_IPIP); return pllink; } const NMPlatformLink * -nmtstp_link_macvlan_add (gboolean external_command, +nmtstp_link_macvlan_add (NMPlatform *platform, + gboolean external_command, const char *name, int parent, const NMPlatformLnkMacvlan *lnk) @@ -868,6 +1092,8 @@ nmtstp_link_macvlan_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + link_type = lnk->tap ? NM_LINK_TYPE_MACVTAP : NM_LINK_TYPE_MACVLAN; if (external_command) { @@ -879,7 +1105,7 @@ nmtstp_link_macvlan_add (gboolean external_command, [MACVLAN_MODE_PASSTHRU] = "passthru", }; - dev = nm_platform_link_get_name (NM_PLATFORM_GET, parent); + dev = nm_platform_link_get_name (platform, parent); g_assert (dev); g_assert_cmpint (lnk->mode, <, G_N_ELEMENTS (modes)); @@ -890,17 +1116,18 @@ nmtstp_link_macvlan_add (gboolean external_command, modes[lnk->mode], lnk->no_promisc ? "nopromisc" : ""); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, link_type, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, link_type, 100); } else - success = nm_platform_link_macvlan_add (NM_PLATFORM_GET, name, parent, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_macvlan_add (platform, name, parent, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, link_type); + _assert_pllink (platform, success, pllink, name, link_type); return pllink; } const NMPlatformLink * -nmtstp_link_sit_add (gboolean external_command, +nmtstp_link_sit_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkSit *lnk) { @@ -912,13 +1139,15 @@ nmtstp_link_sit_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { const char *dev = ""; if (lnk->parent_ifindex) { const char *parent_name; - parent_name = nm_platform_link_get_name (NM_PLATFORM_GET, lnk->parent_ifindex); + parent_name = nm_platform_link_get_name (platform, lnk->parent_ifindex); g_assert (parent_name); dev = nm_sprintf_bufa (100, " dev %s", parent_name); } @@ -932,17 +1161,18 @@ nmtstp_link_sit_add (gboolean external_command, lnk->tos, lnk->path_mtu_discovery ? "pmtudisc" : "nopmtudisc"); if (success) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_SIT, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_SIT, 100); } else - success = nm_platform_link_sit_add (NM_PLATFORM_GET, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; + success = nm_platform_link_sit_add (platform, name, lnk, &pllink) == NM_PLATFORM_ERROR_SUCCESS; - _assert_pllink (NM_PLATFORM_GET, success, pllink, name, NM_LINK_TYPE_SIT); + _assert_pllink (platform, success, pllink, name, NM_LINK_TYPE_SIT); return pllink; } const NMPlatformLink * -nmtstp_link_vxlan_add (gboolean external_command, +nmtstp_link_vxlan_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkVxlan *lnk) { @@ -954,12 +1184,14 @@ nmtstp_link_vxlan_add (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { gs_free char *dev = NULL; gs_free char *local = NULL, *remote = NULL; if (lnk->parent_ifindex) - dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (NM_PLATFORM_GET, lnk->parent_ifindex)); + dev = g_strdup_printf ("dev %s", nm_platform_link_get_name (platform, lnk->parent_ifindex)); if (lnk->local) local = g_strdup_printf ("%s", nm_utils_inet4_ntop (lnk->local, NULL)); @@ -985,12 +1217,12 @@ nmtstp_link_vxlan_add (gboolean external_command, /* Older versions of iproute2 don't support adding vxlan devices. * On failure, fallback to using platform code. */ if (err == 0) - pllink = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, name, NM_LINK_TYPE_VXLAN, 100); + pllink = nmtstp_assert_wait_for_link (platform, name, NM_LINK_TYPE_VXLAN, 100); else _LOGI ("Adding vxlan device via iproute2 failed. Assume iproute2 is not up to the task."); } if (!pllink) { - plerr = nm_platform_link_vxlan_add (NM_PLATFORM_GET, name, lnk, &pllink); + plerr = nm_platform_link_vxlan_add (platform, name, lnk, &pllink); g_assert_cmpint (plerr, ==, NM_PLATFORM_ERROR_SUCCESS); g_assert (pllink); } @@ -1000,168 +1232,7 @@ nmtstp_link_vxlan_add (gboolean external_command, return pllink; } -void -nmtstp_ip4_address_add (gboolean external_command, - int ifindex, - in_addr_t address, - int plen, - in_addr_t peer_address, - guint32 lifetime, - guint32 preferred, - guint32 flags, - const char *label) -{ - _ip_address_add (external_command, - TRUE, - ifindex, - (NMIPAddr *) &address, - plen, - (NMIPAddr *) &peer_address, - lifetime, - preferred, - flags, - label); -} - -void -nmtstp_ip6_address_add (gboolean external_command, - int ifindex, - struct in6_addr address, - int plen, - struct in6_addr peer_address, - guint32 lifetime, - guint32 preferred, - guint32 flags) -{ - _ip_address_add (external_command, - FALSE, - ifindex, - (NMIPAddr *) &address, - plen, - (NMIPAddr *) &peer_address, - lifetime, - preferred, - flags, - NULL); -} - -static void -_ip_address_del (gboolean external_command, - gboolean is_v4, - int ifindex, - const NMIPAddr *address, - int plen, - const NMIPAddr *peer_address) -{ - gint64 end_time; - - external_command = nmtstp_run_command_check_external (external_command); - - if (external_command) { - const char *ifname; - char b1[NM_UTILS_INET_ADDRSTRLEN], b2[NM_UTILS_INET_ADDRSTRLEN]; - int success; - gboolean had_address; - - ifname = nm_platform_link_get_name (NM_PLATFORM_GET, ifindex); - g_assert (ifname); - - /* let's wait until we see the address as we added it. */ - if (is_v4) - had_address = !!nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, address->addr4, plen, peer_address->addr4); - else - had_address = !!nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, address->addr6, plen); - - if (is_v4) { - success = nmtstp_run_command ("ip address delete %s%s%s/%d dev %s", - nm_utils_inet4_ntop (address->addr4, b1), - peer_address->addr4 != address->addr4 ? " peer " : "", - peer_address->addr4 != address->addr4 ? nm_utils_inet4_ntop (peer_address->addr4, b2) : "", - plen, - ifname); - } else { - g_assert (!peer_address); - success = nmtstp_run_command ("ip address delete %s/%d dev %s", - nm_utils_inet6_ntop (&address->addr6, b1), - plen, - ifname); - } - g_assert (success == 0 || !had_address); - } else { - gboolean success; - - if (is_v4) { - success = nm_platform_ip4_address_delete (NM_PLATFORM_GET, - ifindex, - address->addr4, - plen, - peer_address->addr4); - } else { - g_assert (!peer_address); - success = nm_platform_ip6_address_delete (NM_PLATFORM_GET, - ifindex, - address->addr6, - plen); - } - g_assert (success); - } - - /* Let's wait until we get the result */ - end_time = nm_utils_get_monotonic_timestamp_ms () + 250; - do { - if (external_command) - nm_platform_process_events (NM_PLATFORM_GET); - - /* let's wait until we see the address as we added it. */ - if (is_v4) { - const NMPlatformIP4Address *a; - - a = nm_platform_ip4_address_get (NM_PLATFORM_GET, ifindex, address->addr4, plen, peer_address->addr4); - if (!a) - break; - } else { - const NMPlatformIP6Address *a; - - a = nm_platform_ip6_address_get (NM_PLATFORM_GET, ifindex, address->addr6, plen); - if (!a) - break; - } - - /* for internal command, we expect not to reach this line.*/ - g_assert (external_command); - - g_assert (nmtstp_wait_for_signal_until (NM_PLATFORM_GET, end_time)); - } while (TRUE); -} - -void -nmtstp_ip4_address_del (gboolean external_command, - int ifindex, - in_addr_t address, - int plen, - in_addr_t peer_address) -{ - _ip_address_del (external_command, - TRUE, - ifindex, - (NMIPAddr *) &address, - plen, - (NMIPAddr *) &peer_address); -} - -void -nmtstp_ip6_address_del (gboolean external_command, - int ifindex, - struct in6_addr address, - int plen) -{ - _ip_address_del (external_command, - FALSE, - ifindex, - (NMIPAddr *) &address, - plen, - NULL); -} +/*****************************************************************************/ const NMPlatformLink * nmtstp_link_get_typed (NMPlatform *platform, @@ -1171,8 +1242,7 @@ nmtstp_link_get_typed (NMPlatform *platform, { const NMPlatformLink *pllink = NULL; - if (!platform) - platform = NM_PLATFORM_GET; + _init_platform (&platform, FALSE); if (ifindex > 0) { pllink = nm_platform_link_get (platform, ifindex); @@ -1210,8 +1280,11 @@ nmtstp_link_get (NMPlatform *platform, return nmtstp_link_get_typed (platform, ifindex, name, NM_LINK_TYPE_NONE); } +/*****************************************************************************/ + void -nmtstp_link_del (gboolean external_command, +nmtstp_link_del (NMPlatform *platform, + gboolean external_command, int ifindex, const char *name) { @@ -1220,19 +1293,21 @@ nmtstp_link_del (gboolean external_command, gboolean success; gs_free char *name_copy = NULL; - pllink = nmtstp_link_get (NM_PLATFORM_GET, ifindex, name); + external_command = nmtstp_run_command_check_external (external_command); + + _init_platform (&platform, external_command); + + pllink = nmtstp_link_get (platform, ifindex, name); g_assert (pllink); name = name_copy = g_strdup (pllink->name); ifindex = pllink->ifindex; - external_command = nmtstp_run_command_check_external (external_command); - if (external_command) { nmtstp_run_command_check ("ip link delete %s", name); } else { - success = nm_platform_link_delete (NM_PLATFORM_GET, ifindex); + success = nm_platform_link_delete (platform, ifindex); g_assert (success); } @@ -1240,22 +1315,25 @@ nmtstp_link_del (gboolean external_command, end_time = nm_utils_get_monotonic_timestamp_ms () + 250; do { if (external_command) - nm_platform_process_events (NM_PLATFORM_GET); + nm_platform_process_events (platform); - if (!nm_platform_link_get (NM_PLATFORM_GET, ifindex)) { - g_assert (!nm_platform_link_get_by_ifname (NM_PLATFORM_GET, name)); + if (!nm_platform_link_get (platform, ifindex)) { + g_assert (!nm_platform_link_get_by_ifname (platform, name)); break; } /* for internal command, we expect not to reach this line.*/ g_assert (external_command); - g_assert (nmtstp_wait_for_signal_until (NM_PLATFORM_GET, end_time)); + nmtstp_assert_wait_for_signal_until (platform, end_time); } while (TRUE); } +/*****************************************************************************/ + void -nmtstp_link_set_updown (gboolean external_command, +nmtstp_link_set_updown (NMPlatform *platform, + gboolean external_command, int ifindex, gboolean up) { @@ -1264,10 +1342,12 @@ nmtstp_link_set_updown (gboolean external_command, external_command = nmtstp_run_command_check_external (external_command); + _init_platform (&platform, external_command); + if (external_command) { const char *ifname; - ifname = nm_platform_link_get_name (NM_PLATFORM_GET, ifindex); + ifname = nm_platform_link_get_name (platform, ifindex); g_assert (ifname); nmtstp_run_command_check ("ip link set %s %s", @@ -1275,19 +1355,19 @@ nmtstp_link_set_updown (gboolean external_command, up ? "up" : "down"); } else { if (up) - g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, ifindex, NULL)); + g_assert (nm_platform_link_set_up (platform, ifindex, NULL)); else - g_assert (nm_platform_link_set_down (NM_PLATFORM_GET, ifindex)); + g_assert (nm_platform_link_set_down (platform, ifindex)); } /* Let's wait until we get the result */ end_time = nm_utils_get_monotonic_timestamp_ms () + 250; do { if (external_command) - nm_platform_process_events (NM_PLATFORM_GET); + nm_platform_process_events (platform); /* let's wait until we see the address as we added it. */ - plink = nm_platform_link_get (NM_PLATFORM_GET, ifindex); + plink = nm_platform_link_get (platform, ifindex); g_assert (plink); if (NM_FLAGS_HAS (plink->n_ifi_flags, IFF_UP) == !!up) @@ -1296,7 +1376,7 @@ nmtstp_link_set_updown (gboolean external_command, /* for internal command, we expect not to reach this line.*/ g_assert (external_command); - g_assert (nmtstp_wait_for_signal_until (NM_PLATFORM_GET, end_time)); + nmtstp_assert_wait_for_signal_until (platform, end_time); } while (TRUE); } @@ -1513,7 +1593,7 @@ main (int argc, char **argv) int result; const char *program = *argv; - init_tests (&argc, &argv); + _nmtstp_init_tests (&argc, &argv); if ( nmtstp_is_root_test () && (geteuid () != 0 || getegid () != 0)) { @@ -1571,7 +1651,7 @@ main (int argc, char **argv) SETUP (); - setup_tests (); + _nmtstp_setup_tests (); result = g_test_run (); diff --git a/src/platform/tests/test-common.h b/src/platform/tests/test-common.h index 82561193..0e3cf10b 100644 --- a/src/platform/tests/test-common.h +++ b/src/platform/tests/test-common.h @@ -4,7 +4,6 @@ #include <string.h> #include <arpa/inet.h> -#include "nm-default.h" #include "nm-platform.h" #include "nm-fake-platform.h" #include "nm-linux-platform.h" @@ -38,16 +37,6 @@ /*********************************************************************************************/ -typedef struct { - gulong handler_id; - const char *name; - NMPlatformSignalChangeType change_type; - gint received_count; - GMainLoop *loop; - int ifindex; - const char *ifname; -} SignalData; - gboolean nmtstp_is_root_test (void); gboolean nmtstp_is_sysfs_writable (void); @@ -64,6 +53,16 @@ int nmtstp_namespace_get_fd_for_process (pid_t pid, const char *ns_name); /******************************************************************************/ +typedef struct { + gulong handler_id; + const char *name; + NMPlatformSignalChangeType change_type; + gint received_count; + GMainLoop *loop; + int ifindex; + const char *ifname; +} SignalData; + SignalData *add_signal_full (const char *name, NMPlatformSignalChangeType change_type, GCallback callback, int ifindex, const char *ifname); #define add_signal(name, change_type, callback) add_signal_full (name, change_type, (GCallback) callback, 0, NULL) #define add_signal_ifindex(name, change_type, callback, ifindex) add_signal_full (name, change_type, (GCallback) callback, ifindex, NULL) @@ -81,27 +80,49 @@ void _free_signal (const char *file, int line, const char *func, SignalData *dat #define ensure_no_signal(data) _ensure_no_signal(__FILE__, __LINE__, G_STRFUNC, data) #define free_signal(data) _free_signal(__FILE__, __LINE__, G_STRFUNC, data) -gboolean ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric); - -void _assert_ip4_route_exists (const char *file, guint line, const char *func, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric); -#define assert_ip4_route_exists(exists, ifname, network, plen, metric) _assert_ip4_route_exists (__FILE__, __LINE__, G_STRFUNC, exists, ifname, network, plen, metric) - void link_callback (NMPlatform *platform, NMPObjectType obj_type, int ifindex, NMPlatformLink *received, NMPlatformSignalChangeType change_type, SignalData *data); +/*****************************************************************************/ + int nmtstp_run_command (const char *format, ...) __attribute__((__format__ (__printf__, 1, 2))); #define nmtstp_run_command_check(...) do { g_assert_cmpint (nmtstp_run_command (__VA_ARGS__), ==, 0); } while (0) -gboolean nmtstp_wait_for_signal (NMPlatform *platform, guint timeout_ms); -gboolean nmtstp_wait_for_signal_until (NMPlatform *platform, gint64 until_ms); +/*****************************************************************************/ + +guint nmtstp_wait_for_signal (NMPlatform *platform, guint timeout_ms); +guint nmtstp_wait_for_signal_until (NMPlatform *platform, gint64 until_ms); const NMPlatformLink *nmtstp_wait_for_link (NMPlatform *platform, const char *ifname, NMLinkType expected_link_type, guint timeout_ms); const NMPlatformLink *nmtstp_wait_for_link_until (NMPlatform *platform, const char *ifname, NMLinkType expected_link_type, gint64 until_ms); +#define nmtstp_assert_wait_for_signal(platform, timeout_ms) \ + G_STMT_START { \ + if (nmtstp_wait_for_signal (platform, timeout_ms) == 0) \ + g_assert_not_reached (); \ + } G_STMT_END + +#define nmtstp_assert_wait_for_signal_until(platform, until_ms) \ + G_STMT_START { \ + if (nmtstp_wait_for_signal_until (platform, until_ms) == 0) \ + g_assert_not_reached (); \ + } G_STMT_END + const NMPlatformLink *nmtstp_assert_wait_for_link (NMPlatform *platform, const char *ifname, NMLinkType expected_link_type, guint timeout_ms); const NMPlatformLink *nmtstp_assert_wait_for_link_until (NMPlatform *platform, const char *ifname, NMLinkType expected_link_type, gint64 until_ms); +/*****************************************************************************/ + int nmtstp_run_command_check_external_global (void); gboolean nmtstp_run_command_check_external (int external_command); +/*****************************************************************************/ + +gboolean nmtstp_ip4_route_exists (const char *ifname, guint32 network, int plen, guint32 metric); + +void _nmtstp_assert_ip4_route_exists (const char *file, guint line, const char *func, NMPlatform *platform, gboolean exists, const char *ifname, guint32 network, int plen, guint32 metric); +#define nmtstp_assert_ip4_route_exists(platform, exists, ifname, network, plen, metric) _nmtstp_assert_ip4_route_exists (__FILE__, __LINE__, G_STRFUNC, platform, exists, ifname, network, plen, metric) + +/*****************************************************************************/ + gboolean nmtstp_ip_address_check_lifetime (const NMPlatformIPAddress *addr, gint64 now, guint32 expected_lifetime, @@ -110,7 +131,9 @@ void nmtstp_ip_address_assert_lifetime (const NMPlatformIPAddress *addr, gint64 now, guint32 expected_lifetime, guint32 expected_preferred); -void nmtstp_ip4_address_add (gboolean external_command, + +void nmtstp_ip4_address_add (NMPlatform *platform, + gboolean external_command, int ifindex, in_addr_t address, int plen, @@ -119,7 +142,8 @@ void nmtstp_ip4_address_add (gboolean external_command, guint32 preferred, guint32 flags, const char *label); -void nmtstp_ip6_address_add (gboolean external_command, +void nmtstp_ip6_address_add (NMPlatform *platform, + gboolean external_command, int ifindex, struct in6_addr address, int plen, @@ -127,49 +151,64 @@ void nmtstp_ip6_address_add (gboolean external_command, guint32 lifetime, guint32 preferred, guint32 flags); -void nmtstp_ip4_address_del (gboolean external_command, +void nmtstp_ip4_address_del (NMPlatform *platform, + gboolean external_command, int ifindex, in_addr_t address, int plen, in_addr_t peer_address); -void nmtstp_ip6_address_del (gboolean external_command, +void nmtstp_ip6_address_del (NMPlatform *platform, + gboolean external_command, int ifindex, struct in6_addr address, int plen); +/*****************************************************************************/ + const NMPlatformLink *nmtstp_link_get_typed (NMPlatform *platform, int ifindex, const char *name, NMLinkType link_type); const NMPlatformLink *nmtstp_link_get (NMPlatform *platform, int ifindex, const char *name); -void nmtstp_link_set_updown (gboolean external_command, +void nmtstp_link_set_updown (NMPlatform *platform, + gboolean external_command, int ifindex, gboolean up); -const NMPlatformLink *nmtstp_link_dummy_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_dummy_add (NMPlatform *platform, + gboolean external_command, const char *name); -const NMPlatformLink *nmtstp_link_gre_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_gre_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkGre *lnk); -const NMPlatformLink *nmtstp_link_ip6tnl_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_ip6tnl_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkIp6Tnl *lnk); -const NMPlatformLink *nmtstp_link_ipip_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_ipip_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkIpIp *lnk); -const NMPlatformLink *nmtstp_link_macvlan_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_macvlan_add (NMPlatform *platform, + gboolean external_command, const char *name, int parent, const NMPlatformLnkMacvlan *lnk); -const NMPlatformLink *nmtstp_link_sit_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_sit_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkSit *lnk); -const NMPlatformLink *nmtstp_link_vxlan_add (gboolean external_command, +const NMPlatformLink *nmtstp_link_vxlan_add (NMPlatform *platform, + gboolean external_command, const char *name, const NMPlatformLnkVxlan *lnk); -void nmtstp_link_del (gboolean external_command, +void nmtstp_link_del (NMPlatform *platform, + gboolean external_command, int ifindex, const char *name); -void init_tests (int *argc, char ***argv); -void setup_tests (void); +/*****************************************************************************/ + +void _nmtstp_init_tests (int *argc, char ***argv); +void _nmtstp_setup_tests (void); diff --git a/src/platform/tests/test-general.c b/src/platform/tests/test-general.c index 66f72fa5..d8d92561 100644 --- a/src/platform/tests/test-general.c +++ b/src/platform/tests/test-general.c @@ -35,7 +35,7 @@ test_init_linux_platform (void) { gs_unref_object NMPlatform *platform = NULL; - platform = g_object_new (NM_TYPE_LINUX_PLATFORM, NULL); + platform = nm_linux_platform_new (NM_PLATFORM_NETNS_SUPPORT_DEFAULT); } /******************************************************************/ @@ -46,7 +46,7 @@ test_link_get_all (void) gs_unref_object NMPlatform *platform = NULL; gs_unref_array GArray *links = NULL; - platform = g_object_new (NM_TYPE_LINUX_PLATFORM, NULL); + platform = nm_linux_platform_new (NM_PLATFORM_NETNS_SUPPORT_DEFAULT); links = nm_platform_link_get_all (platform); } diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 94695edc..9d548aab 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -343,7 +343,7 @@ test_slave (int master, int type, SignalData *master_changed) ensure_no_signal (link_added); ensure_no_signal (link_changed); ensure_no_signal (link_removed); - nmtstp_link_del (-1, ifindex, NULL); + nmtstp_link_del (NULL, -1, ifindex, NULL); accept_signals (master_changed, 0, 1); accept_signals (link_changed, 0, 1); accept_signal (link_removed); @@ -437,7 +437,7 @@ test_software (NMLinkType link_type, const char *link_typename) free_signal (link_changed); /* Delete */ - nmtstp_link_del (-1, ifindex, DEVICE_NAME); + nmtstp_link_del (NULL, -1, ifindex, DEVICE_NAME); accept_signal (link_removed); /* Delete again */ @@ -448,7 +448,7 @@ test_software (NMLinkType link_type, const char *link_typename) if (link_type == NM_LINK_TYPE_VLAN) { SignalData *link_removed_parent = add_signal_ifindex (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_REMOVED, link_callback, vlan_parent); - nmtstp_link_del (-1, vlan_parent, NULL); + nmtstp_link_del (NULL, -1, vlan_parent, NULL); accept_signal (link_removed_parent); free_signal (link_removed_parent); } @@ -531,7 +531,7 @@ test_bridge_addr (void) g_assert_cmpint (plink->addr.len, ==, sizeof (addr)); g_assert (!memcmp (plink->addr.data, addr, sizeof (addr))); - nmtstp_link_del (-1, link.ifindex, link.name); + nmtstp_link_del (NULL, -1, link.ifindex, link.name); } /*****************************************************************************/ @@ -606,7 +606,7 @@ test_internal (void) accept_signal (link_changed); /* Delete device */ - nmtstp_link_del (-1, ifindex, DEVICE_NAME); + nmtstp_link_del (NULL, -1, ifindex, DEVICE_NAME); accept_signal (link_removed); /* Try to delete again */ @@ -717,7 +717,7 @@ test_software_detect (gconstpointer user_data) gracefully_skip = nm_utils_modprobe (NULL, TRUE, "ip_gre", NULL) != 0; } - if (!nmtstp_link_gre_add (ext, DEVICE_NAME, &lnk_gre)) { + if (!nmtstp_link_gre_add (NULL, ext, DEVICE_NAME, &lnk_gre)) { if (gracefully_skip) { g_test_skip ("Cannot create gre tunnel because of missing ip_gre module (modprobe ip_gre)"); goto out_delete_parent; @@ -741,7 +741,7 @@ test_software_detect (gconstpointer user_data) lnk_ipip.tos = 32; lnk_ipip.path_mtu_discovery = FALSE; - if (!nmtstp_link_ipip_add (ext, DEVICE_NAME, &lnk_ipip)) { + if (!nmtstp_link_ipip_add (NULL, ext, DEVICE_NAME, &lnk_ipip)) { if (gracefully_skip) { g_test_skip ("Cannot create ipip tunnel because of missing ipip module (modprobe ipip)"); goto out_delete_parent; @@ -767,7 +767,7 @@ test_software_detect (gconstpointer user_data) lnk_ip6tnl.flow_label = 1337; lnk_ip6tnl.proto = IPPROTO_IPV6; - if (!nmtstp_link_ip6tnl_add (ext, DEVICE_NAME, &lnk_ip6tnl)) { + if (!nmtstp_link_ip6tnl_add (NULL, ext, DEVICE_NAME, &lnk_ip6tnl)) { if (gracefully_skip) { g_test_skip ("Cannot create ip6tnl tunnel because of missing ip6_tunnel module (modprobe ip6_tunnel)"); goto out_delete_parent; @@ -783,7 +783,7 @@ test_software_detect (gconstpointer user_data) lnk_macvlan.no_promisc = FALSE; lnk_macvlan.tap = FALSE; - if (!nmtstp_link_macvlan_add (ext, DEVICE_NAME, ifindex_parent, &lnk_macvlan)) + if (!nmtstp_link_macvlan_add (NULL, ext, DEVICE_NAME, ifindex_parent, &lnk_macvlan)) g_error ("Failed adding MACVLAN interface"); break; } @@ -794,7 +794,7 @@ test_software_detect (gconstpointer user_data) lnk_macvtap.no_promisc = FALSE; lnk_macvtap.tap = TRUE; - if (!nmtstp_link_macvlan_add (ext, DEVICE_NAME, ifindex_parent, &lnk_macvtap)) + if (!nmtstp_link_macvlan_add (NULL, ext, DEVICE_NAME, ifindex_parent, &lnk_macvtap)) g_error ("Failed adding MACVTAP interface"); break; } @@ -814,7 +814,7 @@ test_software_detect (gconstpointer user_data) gracefully_skip = nm_utils_modprobe (NULL, TRUE, "sit", NULL) != 0; } - if (!nmtstp_link_sit_add (ext, DEVICE_NAME, &lnk_sit)) { + if (!nmtstp_link_sit_add (NULL, ext, DEVICE_NAME, &lnk_sit)) { if (gracefully_skip) { g_test_skip ("Cannot create sit tunnel because of missing sit module (modprobe sit)"); goto out_delete_parent; @@ -853,7 +853,7 @@ test_software_detect (gconstpointer user_data) break; } - g_assert (nmtstp_link_vxlan_add (ext, DEVICE_NAME, &lnk_vxlan)); + g_assert (nmtstp_link_vxlan_add (NULL, ext, DEVICE_NAME, &lnk_vxlan)); break; } default: @@ -862,7 +862,7 @@ test_software_detect (gconstpointer user_data) ifindex = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, DEVICE_NAME, test_data->link_type, 100)->ifindex; - nmtstp_link_set_updown (-1, ifindex_parent, TRUE); + nmtstp_link_set_updown (NULL, -1, ifindex_parent, TRUE); for (i_step = 0; i_step < 5; i_step++) { @@ -880,7 +880,7 @@ test_software_detect (gconstpointer user_data) * https://bugzilla.redhat.com/show_bug.cgi?id=1277131 */ g_usleep (1); } - nmtstp_link_set_updown (-1, ifindex, set_up); + nmtstp_link_set_updown (NULL, -1, ifindex, set_up); } lnk = nm_platform_link_get_lnk (NM_PLATFORM_GET, ifindex, test_data->link_type, &plink); @@ -1017,9 +1017,9 @@ test_software_detect (gconstpointer user_data) } } - nmtstp_link_del (-1, ifindex, DEVICE_NAME); + nmtstp_link_del (NULL, -1, ifindex, DEVICE_NAME); out_delete_parent: - nmtstp_link_del (-1, ifindex_parent, PARENT_NAME); + nmtstp_link_del (NULL, -1, ifindex_parent, PARENT_NAME); } static void @@ -1597,8 +1597,8 @@ test_vlan_set_xgress (void) _assert_vlan_flags (ifindex, NM_VLAN_FLAG_REORDER_HEADERS | NM_VLAN_FLAG_GVRP); } - nmtstp_link_del (-1, ifindex, DEVICE_NAME); - nmtstp_link_del (-1, ifindex_parent, PARENT_NAME); + nmtstp_link_del (NULL, -1, ifindex, DEVICE_NAME); + nmtstp_link_del (NULL, -1, ifindex_parent, PARENT_NAME); } /*****************************************************************************/ @@ -1625,7 +1625,7 @@ test_create_many_links_do (guint n_devices) * while adding all the links. */ nmtstp_run_command_check ("ip link add %s type dummy", name); } else - nmtstp_link_dummy_add (EX, name); + nmtstp_link_dummy_add (NULL, EX, name); } _LOGI (">>> process events after creating devices..."); @@ -1654,7 +1654,7 @@ test_create_many_links_do (guint n_devices) if (EX == 2) nmtstp_run_command_check ("ip link delete %s", name); else - nmtstp_link_del (EX, g_array_index (ifindexes, int, i), name); + nmtstp_link_del (NULL, EX, g_array_index (ifindexes, int, i), name); } _LOGI (">>> process events after deleting devices..."); @@ -1743,7 +1743,7 @@ test_nl_bugs_veth (void) }); out: - nmtstp_link_del (-1, ifindex_veth0, IFACE_VETH0); + nmtstp_link_del (NULL, -1, ifindex_veth0, IFACE_VETH0); g_assert (!nmtstp_link_get (NM_PLATFORM_GET, ifindex_veth0, IFACE_VETH0)); g_assert (!nmtstp_link_get (NM_PLATFORM_GET, ifindex_veth1, IFACE_VETH1)); nmtstp_namespace_handle_release (ns_handle); @@ -1768,7 +1768,7 @@ test_nl_bugs_spuroius_newlink (void) nmtstp_run_command_check ("ip link add %s type bond", IFACE_BOND0); ifindex_bond0 = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, IFACE_BOND0, NM_LINK_TYPE_BOND, 100)->ifindex; - nmtstp_link_set_updown (-1, ifindex_bond0, TRUE); + nmtstp_link_set_updown (NULL, -1, ifindex_bond0, TRUE); nmtstp_run_command_check ("ip link set %s master %s", IFACE_DUMMY0, IFACE_BOND0); NMTST_WAIT_ASSERT (100, { @@ -1796,7 +1796,7 @@ again: } g_assert (!nmtstp_link_get (NM_PLATFORM_GET, ifindex_bond0, IFACE_BOND0)); - nmtstp_link_del (-1, ifindex_dummy0, IFACE_DUMMY0); + nmtstp_link_del (NULL, -1, ifindex_dummy0, IFACE_DUMMY0); } /*****************************************************************************/ @@ -1818,7 +1818,7 @@ test_nl_bugs_spuroius_dellink (void) nmtstp_run_command_check ("ip link add %s type bridge", IFACE_BRIDGE0); ifindex_bridge0 = nmtstp_assert_wait_for_link (NM_PLATFORM_GET, IFACE_BRIDGE0, NM_LINK_TYPE_BRIDGE, 100)->ifindex; - nmtstp_link_set_updown (-1, ifindex_bridge0, TRUE); + nmtstp_link_set_updown (NULL, -1, ifindex_bridge0, TRUE); nmtstp_run_command_check ("ip link set %s master %s", IFACE_DUMMY0, IFACE_BRIDGE0); NMTST_WAIT_ASSERT (100, { @@ -1850,8 +1850,8 @@ again: goto again; } - nmtstp_link_del (-1, ifindex_bridge0, IFACE_BRIDGE0); - nmtstp_link_del (-1, ifindex_dummy0, IFACE_DUMMY0); + nmtstp_link_del (NULL, -1, ifindex_bridge0, IFACE_BRIDGE0); + nmtstp_link_del (NULL, -1, ifindex_dummy0, IFACE_DUMMY0); } /******************************************************************/ @@ -1880,7 +1880,7 @@ _test_netns_create_platform (void) netns = nmp_netns_new (); g_assert (NMP_IS_NETNS (netns)); - platform = g_object_new (NM_TYPE_LINUX_PLATFORM, NM_PLATFORM_NETNS_SUPPORT, TRUE, NULL); + platform = nm_linux_platform_new (TRUE); g_assert (NM_IS_LINUX_PLATFORM (platform)); nmp_netns_pop (netns); @@ -1932,7 +1932,7 @@ test_netns_general (gpointer fixture, gconstpointer test_data) if (_test_netns_check_skip ()) return; - platform_1 = g_object_new (NM_TYPE_LINUX_PLATFORM, NM_PLATFORM_NETNS_SUPPORT, TRUE, NULL); + platform_1 = nm_linux_platform_new (TRUE); platform_2 = _test_netns_create_platform (); /* add some dummy devices. The "other-*" devices are there to bump the ifindex */ @@ -2028,7 +2028,7 @@ test_netns_set_netns (gpointer fixture, gconstpointer test_data) if (_test_netns_check_skip ()) return; - platforms[0] = platform_0 = g_object_new (NM_TYPE_LINUX_PLATFORM, NM_PLATFORM_NETNS_SUPPORT, TRUE, NULL); + platforms[0] = platform_0 = nm_linux_platform_new (TRUE); platforms[1] = platform_1 = _test_netns_create_platform (); platforms[2] = platform_2 = _test_netns_create_platform (); @@ -2125,7 +2125,7 @@ test_netns_push (gpointer fixture, gconstpointer test_data) if (_test_netns_check_skip ()) return; - pl[0].platform = platform_0 = g_object_new (NM_TYPE_LINUX_PLATFORM, NM_PLATFORM_NETNS_SUPPORT, TRUE, NULL); + pl[0].platform = platform_0 = nm_linux_platform_new (TRUE); pl[1].platform = platform_1 = _test_netns_create_platform (); pl[2].platform = platform_2 = _test_netns_create_platform (); @@ -2257,7 +2257,7 @@ test_netns_bind_to_path (gpointer fixture, gconstpointer test_data) if (_test_netns_check_skip ()) return; - platforms[0] = platform_0 = g_object_new (NM_TYPE_LINUX_PLATFORM, NM_PLATFORM_NETNS_SUPPORT, TRUE, NULL); + platforms[0] = platform_0 = nm_linux_platform_new (TRUE); platforms[1] = platform_1 = _test_netns_create_platform (); platforms[2] = platform_2 = _test_netns_create_platform (); @@ -2293,13 +2293,13 @@ test_netns_bind_to_path (gpointer fixture, gconstpointer test_data) /*****************************************************************************/ void -init_tests (int *argc, char ***argv) +_nmtstp_init_tests (int *argc, char ***argv) { nmtst_init_with_logging (argc, argv, NULL, "ALL"); } void -setup_tests (void) +_nmtstp_setup_tests (void) { nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME)); nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, SLAVE_NAME)); diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index 85851854..a50392a6 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -82,50 +82,50 @@ test_ip4_route_metric0 (void) int mss = 1000; /* No routes initially */ - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, metric); /* add the first route */ g_assert (nm_platform_ip4_route_add (NM_PLATFORM_GET, ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, INADDR_ANY, 0, metric, mss)); accept_signal (route_added); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); /* Deleting route with metric 0 does nothing */ g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, plen, 0)); ensure_no_signal (route_removed); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); /* add the second route */ g_assert (nm_platform_ip4_route_add (NM_PLATFORM_GET, ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, INADDR_ANY, 0, 0, mss)); accept_signal (route_added); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); /* Delete route with metric 0 */ g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, plen, 0)); accept_signal (route_removed); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); /* Delete route with metric 0 again (we expect nothing to happen) */ g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, plen, 0)); ensure_no_signal (route_removed); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); /* Delete the other route */ g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, plen, metric)); accept_signal (route_removed); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, 0); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, 0); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, metric); free_signal (route_added); free_signal (route_changed); @@ -142,7 +142,7 @@ test_ip4_route (void) GArray *routes; NMPlatformIP4Route rts[3]; in_addr_t network; - int plen = 24; + guint8 plen = 24; in_addr_t gateway; /* Choose a high metric so that we hopefully don't conflict. */ int metric = 22986; @@ -156,9 +156,9 @@ test_ip4_route (void) accept_signal (route_added); /* Add route */ - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, metric); g_assert (nm_platform_ip4_route_add (NM_PLATFORM_GET, ifindex, NM_IP_CONFIG_SOURCE_USER, network, plen, gateway, 0, metric, mss)); - assert_ip4_route_exists (TRUE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, network, plen, metric); accept_signal (route_added); /* Add route again */ @@ -166,9 +166,9 @@ test_ip4_route (void) accept_signals (route_changed, 0, 1); /* Add default route */ - assert_ip4_route_exists (FALSE, DEVICE_NAME, 0, 0, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, 0, 0, metric); g_assert (nm_platform_ip4_route_add (NM_PLATFORM_GET, ifindex, NM_IP_CONFIG_SOURCE_USER, 0, 0, gateway, 0, metric, mss)); - assert_ip4_route_exists (TRUE, DEVICE_NAME, 0, 0, metric); + nmtstp_assert_ip4_route_exists (NULL, TRUE, DEVICE_NAME, 0, 0, metric); accept_signal (route_added); /* Add default route again */ @@ -208,7 +208,7 @@ test_ip4_route (void) /* Remove route */ g_assert (nm_platform_ip4_route_delete (NM_PLATFORM_GET, ifindex, network, plen, metric)); - assert_ip4_route_exists (FALSE, DEVICE_NAME, network, plen, metric); + nmtstp_assert_ip4_route_exists (NULL, FALSE, DEVICE_NAME, network, plen, metric); accept_signal (route_removed); /* Remove route again */ @@ -229,7 +229,7 @@ test_ip6_route (void) GArray *routes; NMPlatformIP6Route rts[3]; struct in6_addr network; - int plen = 64; + guint8 plen = 64; struct in6_addr gateway; /* Choose a high metric so that we hopefully don't conflict. */ int metric = 22987; @@ -329,13 +329,13 @@ test_ip4_zero_gateway (void) /*****************************************************************************/ void -init_tests (int *argc, char ***argv) +_nmtstp_init_tests (int *argc, char ***argv) { nmtst_init_with_logging (argc, argv, NULL, "ALL"); } void -setup_tests (void) +_nmtstp_setup_tests (void) { SignalData *link_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, DEVICE_NAME); |