Close Unused Sessions in NonceFlood Unit Test

Merge from widevine of http://go/wvgerrit/14263

The unit test PreventNonceFlood3 opens 8 sessions and floods the nonce
table.  It then opens one more session after a pause to verify that it
can still request nonces.  However, there is no requirement that we
can open more than 8 sessions.  This CL reuses one of the already open
sessions to verify that we can continue generating nonces.

Change-Id: If35f146477bd21e381ec5375dde7ec7fdbe8f366
This commit is contained in:
Fred Gylys-Colwell
2015-05-01 15:55:34 -07:00
parent f18021f99a
commit 48e84580e9

View File

@@ -1778,10 +1778,8 @@ TEST_F(OEMCryptoClientTest, PreventNonceFlood3) {
EXPECT_LE(valid_counter, 20 * (test_end - test_start + 2));
error_counter = 0;
sleep(2); // After a pause, we should be able to regenerate nonces.
Session s7;
s7.open();
EXPECT_TRUE(s7.isOpen());
s7.GenerateNonce(&nonce, &error_counter);
EXPECT_TRUE(s[0].isOpen());
s[0].GenerateNonce(&nonce, &error_counter);
EXPECT_EQ(0, error_counter);
}