module-transaction: Do not allow parallel conversations by default

Pam conversations per se may also run in parallel, but this implies that
the application supports this.

Since this normally not the case, do not create modules that may invoke
the pam conversations in parallel by default, adding a mutex to protect
such calls.
This commit is contained in:
Marco Trevisan (Treviño)
2023-10-13 19:24:49 +02:00
parent ac879208ea
commit 04ad7bdc73
5 changed files with 51 additions and 12 deletions

View File

@@ -305,11 +305,10 @@ func Test_ModuleTransaction_InvokeHandler(t *testing.T) {
}
}
func Test_MockModuleTransaction(t *testing.T) {
func testMockModuleTransaction(t *testing.T, mt *moduleTransaction) {
t.Helper()
t.Parallel()
mt, _ := NewModuleTransactionInvoker(nil).(*moduleTransaction)
tests := map[string]struct {
testFunc func(mock *mockModuleTransaction) (any, error)
mockExpectations mockModuleTransactionExpectations
@@ -914,3 +913,13 @@ func Test_MockModuleTransaction(t *testing.T) {
})
}
}
func Test_MockModuleTransaction(t *testing.T) {
mt, _ := NewModuleTransactionInvoker(nil).(*moduleTransaction)
testMockModuleTransaction(t, mt)
}
func Test_MockModuleTransactionParallelConv(t *testing.T) {
mt, _ := NewModuleTransactionInvokerParallelConv(nil).(*moduleTransaction)
testMockModuleTransaction(t, mt)
}