Hello community,

here is the log from the commit of package tpm2.0-abrmd for openSUSE:Factory 
checked in at 2019-08-27 10:23:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tpm2.0-abrmd (Old)
 and      /work/SRC/openSUSE:Factory/.tpm2.0-abrmd.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tpm2.0-abrmd"

Tue Aug 27 10:23:15 2019 rev:15 rq:726060 version:2.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/tpm2.0-abrmd/tpm2.0-abrmd.changes        
2019-04-26 22:55:02.493292269 +0200
+++ /work/SRC/openSUSE:Factory/.tpm2.0-abrmd.new.7948/tpm2.0-abrmd.changes      
2019-08-27 10:23:39.811930466 +0200
@@ -1,0 +2,10 @@
+Mon Aug 26 06:49:37 UTC 2019 - mgerstner <[email protected]>
+
+- update to version 2.1.1:
+  - changes in version 2.1.1:
+    - Unit tests accessing dbus have been fixed to use mock functions. Unit
+    tests no longer depend on dbus.
+    - Race condition between client connections and dbus proxy object
+    creation by registering bus name after instantiation of the proxy object.
+
+-------------------------------------------------------------------

Old:
----
  tpm2-abrmd-2.1.0.tar.gz

New:
----
  tpm2-abrmd-2.1.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tpm2.0-abrmd.spec ++++++
--- /var/tmp/diff_new_pack.1Tg17v/_old  2019-08-27 10:23:40.663930409 +0200
+++ /var/tmp/diff_new_pack.1Tg17v/_new  2019-08-27 10:23:40.663930409 +0200
@@ -12,12 +12,12 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           tpm2.0-abrmd
-Version:        2.1.0
+Version:        2.1.1
 Release:        0
 Summary:        Intel's TCG Software Stack Access Broker & Resource Manager 
for TPM 2.0 chips
 License:        BSD-2-Clause

++++++ _service ++++++
--- /var/tmp/diff_new_pack.1Tg17v/_old  2019-08-27 10:23:40.691930408 +0200
+++ /var/tmp/diff_new_pack.1Tg17v/_new  2019-08-27 10:23:40.691930408 +0200
@@ -2,7 +2,7 @@
   <service name="tar_scm" mode="disabled">
     <param name="url">https://github.com/intel/tpm2-abrmd.git</param>
     <param name="scm">git</param>
-    <param name="revision">2.1.0</param>
+    <param name="revision">2.1.1</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">disable</param>
   </service>

++++++ tpm2-abrmd-2.1.0.tar.gz -> tpm2-abrmd-2.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/AUTHORS new/tpm2-abrmd-2.1.1/AUTHORS
--- old/tpm2-abrmd-2.1.0/AUTHORS        2019-02-06 23:00:59.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/AUTHORS        2019-03-08 21:08:37.000000000 +0100
@@ -16,6 +16,7 @@
 Safayet Ahmed <[email protected]>
 Lukas Vrabec <[email protected]>
 Jia Zhang <[email protected]>
+Jan Luebbe <[email protected]>
 Thomas Furtner <[email protected]>
 Lu Gong <[email protected]>
 Imran Desai <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/CHANGELOG.md 
new/tpm2-abrmd-2.1.1/CHANGELOG.md
--- old/tpm2-abrmd-2.1.0/CHANGELOG.md   2019-02-06 21:52:48.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/CHANGELOG.md   2019-03-08 21:08:06.000000000 +0100
@@ -3,6 +3,18 @@
 
 The format is based on [Keep a CHANGELOG](http://keepachangelog.com/)
 
+## 2.1.1 - 2019-03-08
+### Fixed
+- Unit tests accessing dbus have been fixed to use mock functions. Unit
+tests no longer depend on dbus.
+- Race condition between client connections and dbus proxy object
+creation by registering bus name after instantiation of the proxy object.
+
+## 1.3.3 - 2019-03-08
+### Fixed
+- Race condition between client connections and dbus proxy object
+creation by registering bus name after instantiation of the proxy object.
+
 ## 2.1.0 - 2019-02-06
 ### Added
 - `-Wstrict-overflow=5` now used in default CFLAGS.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/Makefile.am 
new/tpm2-abrmd-2.1.1/Makefile.am
--- old/tpm2-abrmd-2.1.0/Makefile.am    2019-01-28 22:50:26.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/Makefile.am    2019-03-08 21:08:06.000000000 +0100
@@ -445,7 +445,7 @@
 test_tcti_util_unit_SOURCES  = test/tcti-util_unit.c
 
 test_tss2_tcti_tabrmd_unit_CFLAGS  = $(UNIT_AM_CFLAGS)
-test_tss2_tcti_tabrmd_unit_LDFLAGS = 
-Wl,--wrap=g_dbus_proxy_call_with_unix_fd_list_sync,--wrap=tcti_tabrmd_call_cancel_sync,--wrap=tcti_tabrmd_call_set_locality_sync,--wrap=read_data,--wrap=poll
+test_tss2_tcti_tabrmd_unit_LDFLAGS = 
-Wl,--wrap=g_dbus_proxy_call_with_unix_fd_list_sync,--wrap=tcti_tabrmd_call_cancel_sync,--wrap=tcti_tabrmd_call_set_locality_sync,--wrap=read_data,--wrap=poll,--wrap=tcti_tabrmd_proxy_new_for_bus_sync
 test_tss2_tcti_tabrmd_unit_LDADD   = $(CMOCKA_LIBS) $(GIO_LIBS) $(libutil)
 test_tss2_tcti_tabrmd_unit_SOURCES = src/tcti-tabrmd.c 
test/tss2-tcti-tabrmd_unit.c
 endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/Makefile.in 
new/tpm2-abrmd-2.1.1/Makefile.in
--- old/tpm2-abrmd-2.1.0/Makefile.in    2019-02-06 23:00:57.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/Makefile.in    2019-03-08 21:08:34.000000000 +0100
@@ -15,7 +15,7 @@
 @SET_MAKE@
 
 # aminclude_static.am generated automatically by Autoconf
-# from AX_AM_MACROS_STATIC on Wed Feb  6 14:00:56 PST 2019
+# from AX_AM_MACROS_STATIC on Fri Mar  8 12:08:34 PST 2019
 
 
 
@@ -1568,7 +1568,7 @@
 @UNIT_TRUE@test_tcti_util_unit_LDFLAGS = 
-Wl,--wrap=dlopen,--wrap=dlsym,--wrap=dlclose
 @UNIT_TRUE@test_tcti_util_unit_SOURCES = test/tcti-util_unit.c
 @UNIT_TRUE@test_tss2_tcti_tabrmd_unit_CFLAGS = $(UNIT_AM_CFLAGS)
-@UNIT_TRUE@test_tss2_tcti_tabrmd_unit_LDFLAGS = 
-Wl,--wrap=g_dbus_proxy_call_with_unix_fd_list_sync,--wrap=tcti_tabrmd_call_cancel_sync,--wrap=tcti_tabrmd_call_set_locality_sync,--wrap=read_data,--wrap=poll
+@UNIT_TRUE@test_tss2_tcti_tabrmd_unit_LDFLAGS = 
-Wl,--wrap=g_dbus_proxy_call_with_unix_fd_list_sync,--wrap=tcti_tabrmd_call_cancel_sync,--wrap=tcti_tabrmd_call_set_locality_sync,--wrap=read_data,--wrap=poll,--wrap=tcti_tabrmd_proxy_new_for_bus_sync
 @UNIT_TRUE@test_tss2_tcti_tabrmd_unit_LDADD = $(CMOCKA_LIBS) $(GIO_LIBS) 
$(libutil)
 @UNIT_TRUE@test_tss2_tcti_tabrmd_unit_SOURCES = src/tcti-tabrmd.c 
test/tss2-tcti-tabrmd_unit.c
 TEST_INT_LIBS = $(libtest) $(libutil) $(libtss2_tcti_tabrmd) $(GLIB_LIBS)
@@ -3929,8 +3929,8 @@
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-@AUTOCONF_CODE_COVERAGE_2019_01_06_FALSE@clean-local:
 @AUTOCONF_CODE_COVERAGE_2019_01_06_FALSE@distclean-local:
+@AUTOCONF_CODE_COVERAGE_2019_01_06_FALSE@clean-local:
 check-valgrind: check-valgrind-am
 
 check-valgrind-am: check-valgrind-local
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/VERSION new/tpm2-abrmd-2.1.1/VERSION
--- old/tpm2-abrmd-2.1.0/VERSION        2019-02-06 23:00:41.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/VERSION        2019-03-08 21:08:13.000000000 +0100
@@ -1 +1 @@
-2.1.0
+2.1.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/aminclude_static.am 
new/tpm2-abrmd-2.1.1/aminclude_static.am
--- old/tpm2-abrmd-2.1.0/aminclude_static.am    2019-02-06 23:00:56.000000000 
+0100
+++ new/tpm2-abrmd-2.1.1/aminclude_static.am    2019-03-08 21:08:34.000000000 
+0100
@@ -1,4 +1,4 @@
 
 # aminclude_static.am generated automatically by Autoconf
-# from AX_AM_MACROS_STATIC on Wed Feb  6 14:00:56 PST 2019
+# from AX_AM_MACROS_STATIC on Fri Mar  8 12:08:34 PST 2019
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/configure 
new/tpm2-abrmd-2.1.1/configure
--- old/tpm2-abrmd-2.1.0/configure      2019-02-06 23:00:56.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/configure      2019-03-08 21:08:33.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tpm2-abrmd 2.1.0.
+# Generated by GNU Autoconf 2.69 for tpm2-abrmd 2.1.1.
 #
 # Report bugs to <https://github.com/tpm2-software/tpm2-abrmd/issues>.
 #
@@ -591,8 +591,8 @@
 # Identity of this package.
 PACKAGE_NAME='tpm2-abrmd'
 PACKAGE_TARNAME='tpm2-abrmd'
-PACKAGE_VERSION='2.1.0'
-PACKAGE_STRING='tpm2-abrmd 2.1.0'
+PACKAGE_VERSION='2.1.1'
+PACKAGE_STRING='tpm2-abrmd 2.1.1'
 PACKAGE_BUGREPORT='https://github.com/tpm2-software/tpm2-abrmd/issues'
 PACKAGE_URL='https://github.com/tpm2-software/tpm2-abrmd'
 
@@ -1418,7 +1418,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tpm2-abrmd 2.1.0 to adapt to many kinds of systems.
+\`configure' configures tpm2-abrmd 2.1.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1489,7 +1489,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tpm2-abrmd 2.1.0:";;
+     short | recursive ) echo "Configuration of tpm2-abrmd 2.1.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1649,7 +1649,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tpm2-abrmd configure 2.1.0
+tpm2-abrmd configure 2.1.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1927,7 +1927,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tpm2-abrmd $as_me 2.1.0, which was
+It was created by tpm2-abrmd $as_me 2.1.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -11787,7 +11787,7 @@
 
 # Define the identity of the package.
  PACKAGE='tpm2-abrmd'
- VERSION='2.1.0'
+ VERSION='2.1.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16174,7 +16174,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tpm2-abrmd $as_me 2.1.0, which was
+This file was extended by tpm2-abrmd $as_me 2.1.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16232,7 +16232,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-tpm2-abrmd config.status 2.1.0
+tpm2-abrmd config.status 2.1.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/src/ipc-frontend-dbus.c 
new/tpm2-abrmd-2.1.1/src/ipc-frontend-dbus.c
--- old/tpm2-abrmd-2.1.0/src/ipc-frontend-dbus.c        2019-01-04 
01:25:42.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/src/ipc-frontend-dbus.c        2019-03-08 
21:08:06.000000000 +0100
@@ -635,9 +635,17 @@
                    "(org.freedesktop.DBus): %s", error->message);
         g_error_free (error);
         self->dbus_daemon_proxy = NULL;
-    } else {
-        g_debug ("Got proxy object for DBus daemon.");
     }
+    g_debug ("Got proxy object for DBus daemon.");
+
+    self->dbus_name_owner_id = g_bus_own_name (self->bus_type,
+                                               self->bus_name,
+                                               G_BUS_NAME_OWNER_FLAGS_NONE,
+                                               on_bus_acquired,
+                                               on_name_acquired,
+                                               on_name_lost,
+                                               self,
+                                               NULL);
 }
 /*
  * This function overrides the ipc_frontend_connect function from the
@@ -656,14 +664,6 @@
     g_return_if_fail (IS_IPC_FRONTEND_DBUS (self));
 
     frontend->init_mutex = init_mutex;
-    self->dbus_name_owner_id = g_bus_own_name (self->bus_type,
-                                               self->bus_name,
-                                               G_BUS_NAME_OWNER_FLAGS_NONE,
-                                               on_bus_acquired,
-                                               on_name_acquired,
-                                               on_name_lost,
-                                               self,
-                                               NULL);
     g_dbus_proxy_new_for_bus (self->bus_type,
                               G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
                               NULL,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/test/integration/test-options.c 
new/tpm2-abrmd-2.1.1/test/integration/test-options.c
--- old/tpm2-abrmd-2.1.0/test/integration/test-options.c        2019-01-04 
01:25:42.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/test/integration/test-options.c        2019-03-08 
21:08:06.000000000 +0100
@@ -52,8 +52,8 @@
 }
 
 /*
- * Parse command line options from argv extracting test options. These are
- * returned to the caller in the provided options structure.
+ * Extract configuration from environment and populate the provided
+ * `test_opts_t` with the relevant data.
  */
 int
 get_test_opts_from_env (test_opts_t          *test_opts)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tpm2-abrmd-2.1.0/test/tss2-tcti-tabrmd_unit.c 
new/tpm2-abrmd-2.1.1/test/tss2-tcti-tabrmd_unit.c
--- old/tpm2-abrmd-2.1.0/test/tss2-tcti-tabrmd_unit.c   2019-01-04 
01:25:42.000000000 +0100
+++ new/tpm2-abrmd-2.1.1/test/tss2-tcti-tabrmd_unit.c   2019-03-08 
21:08:06.000000000 +0100
@@ -310,7 +310,60 @@
     assert_int_equal (rc, TSS2_TCTI_RC_BAD_VALUE);
 }
 /*
+ * This mock function is used to insert error conditions in the TCTI
+ * initialization function. The function mocked is generated by
+ * gdbus-codegen from the dbus xml. Much of the functionality exposed by
+ * that code uses a 'proxy' object used to interact with the remote
+ * object (tabrmd in this case). The function mocked here is the one used
+ * to connect to the tabrmd.
+ *
+ * The only tricky part to this function is the handling of the GError
+ * object. If the function being mocked failes it returns NULL *and*
+ * populates the error parameter passed by the caller with a GError object
+ * describing the failure. The first item that *must* be on the mock stack
+ * is the TctiTabrmd* being returned. If this is NULL then there MUST be
+ * a second object on the mock stack and this MUST be a GError object. The
+ * caller will g_clear_error this object for us.
+ */
+TctiTabrmd *
+__wrap_tcti_tabrmd_proxy_new_for_bus_sync (
+    GBusType             bus_type,
+    GDBusProxyFlags      flags,
+    const gchar         *name,
+    const gchar         *object_path,
+    GCancellable        *cancellable,
+    GError             **error)
+{
+    UNUSED_PARAM (bus_type);
+    UNUSED_PARAM (flags);
+    UNUSED_PARAM (name);
+    UNUSED_PARAM (object_path);
+    UNUSED_PARAM (cancellable);
+
+    TctiTabrmd* proxy = mock_type (TctiTabrmd*);
+    if (proxy == NULL && error != NULL) {
+        *error = mock_type (GError*);
+    }
+    return proxy;
+}
+
+/*
+ * Force failure acquiring proxy object.
  */
+static void
+tcti_tabrmd_proxy_new_fail (void **state)
+{
+    UNUSED_PARAM (state);
+    size_t size = sizeof (TSS2_TCTI_TABRMD_CONTEXT);
+    uint8_t buf [sizeof (TSS2_TCTI_TABRMD_CONTEXT)] = { 0 };
+    TSS2_RC rc = TSS2_RC_SUCCESS;
+
+    will_return (__wrap_tcti_tabrmd_proxy_new_for_bus_sync, NULL);
+    will_return (__wrap_tcti_tabrmd_proxy_new_for_bus_sync,
+                 g_error_new_literal (1, 1, __func__));
+    rc = Tss2_Tcti_Tabrmd_Init ((TSS2_TCTI_CONTEXT*)buf, &size, NULL);
+    assert_int_equal (rc, TSS2_TCTI_RC_NO_CONNECTION);
+}
 /*
  * This is a mock function to control return values from the connection
  * creation logic that invokes the DBus "CreateConnection" function exposed
@@ -406,6 +459,7 @@
     gint    client_fd;
     gint    server_fd;
     TSS2_TCTI_CONTEXT  *context;
+    TctiTabrmdProxy *proxy;
 } data_t;
 /*
  * This is the setup function used to create the TCTI context structure for
@@ -434,6 +488,8 @@
         perror ("calloc");
         return 1;
     }
+    data->proxy = calloc (1, sizeof (TctiTabrmdProxy));
+    will_return (__wrap_tcti_tabrmd_proxy_new_for_bus_sync, data->proxy);
     g_debug ("preparing g_dbus_proxy_call_with_unix_fd_list_sync mock 
wrapper");
     assert_int_equal (socketpair (PF_LOCAL, SOCK_STREAM, 0, fds), 0);
     data->client_fd = fds [0];
@@ -462,6 +518,8 @@
     close (data->server_fd);
     if (data->context)
         free (data->context);
+    if (data->proxy)
+        free (data->proxy);
     free (data);
     return 0;
 }
@@ -495,12 +553,9 @@
 static void
 tcti_tabrmd_init_success_test (void **state)
 {
-    data_t *data;
+    data_t *data = *state;
 
-    tcti_tabrmd_setup (state);
-    data = *state;
     assert_int_equal (data->id, TSS2_TCTI_TABRMD_ID (data->context));
-    tcti_tabrmd_teardown (state);
 }
 /*
  * These are a series of tests to ensure that the exposed TCTI functions
@@ -1419,7 +1474,10 @@
         cmocka_unit_test (tcti_tabrmd_init_size_test),
         cmocka_unit_test (tcti_tabrmd_init_success_return_value_test),
         cmocka_unit_test (tcti_tabrmd_init_allnull_is_bad_value_test),
-        cmocka_unit_test (tcti_tabrmd_init_success_test),
+        cmocka_unit_test (tcti_tabrmd_proxy_new_fail),
+        cmocka_unit_test_setup_teardown (tcti_tabrmd_init_success_test,
+                                         tcti_tabrmd_setup,
+                                         tcti_tabrmd_teardown),
         cmocka_unit_test (tcti_tabrmd_info_test),
         cmocka_unit_test (tcti_tabrmd_bus_type_from_str_session_test),
         cmocka_unit_test (tcti_tabrmd_bus_type_from_str_system_test),


Reply via email to