diff options
author | Tibor Král <tibor.kral@pantheon.tech> | 2019-03-20 14:29:27 +0100 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2019-03-22 08:13:51 +0000 |
commit | 2a84d439af01675b460079b8853e9f74f8cc922b (patch) | |
tree | 048576be69087454b10ffcaaccf5baefd769e5de /ipsec/ipsec-impl | |
parent | 77f92f6eb231636210192c22a99af3a5ce0a4950 (diff) |
Adds additional tests for Ipsec FLAGS
Change-Id: I059be31630b6c67d542e55e1acb6b038aea9caf9
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Diffstat (limited to 'ipsec/ipsec-impl')
-rw-r--r-- | ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java b/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java index 42840a0cf..b15f54290 100644 --- a/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java +++ b/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java @@ -102,7 +102,7 @@ public class IpsecSadEntryCustomizerTest extends WriterCustomizerTest implements flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY); flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_USE_EXTENDED_SEQ_NUM); flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_IS_TUNNEL); - ; + IpsecSadFlags flags3 = new IpsecSadFlags(); flags3.setOptionsValue(7); @@ -110,6 +110,20 @@ public class IpsecSadEntryCustomizerTest extends WriterCustomizerTest implements assertEquals(flags, flags2); assertEquals(7, flags.getOptionsValue()); assertEquals(flags, flags3); + + assertEquals(false, flags.remove(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + assertEquals(false, flags.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + + flags.removeAll(flags2.getOptions()); + assertEquals(0,flags.getOptionsValue()); + assertEquals(true, flags.contains(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + assertEquals(1,flags.getOptions().size()); + flags.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_IS_TUNNEL); + assertEquals(1,flags.getOptions().size()); + + flags2.clear(); + assertEquals(0,flags2.getOptionsValue()); + assertEquals(true, flags2.contains(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); } @Test |