use of org.batfish.datamodel.IpsecVpn in project batfish by batfish.
the class IpsecVpnStatusAnswererTest method analyzeVpnTestNone.
@Test
public void analyzeVpnTestNone() {
IpsecVpn ipsecVpn = createIpsecVpn("local", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
IpsecVpn remote1 = createIpsecVpn("remote1", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
ipsecVpn.initCandidateRemoteVpns();
ipsecVpn.setRemoteIpsecVpn(remote1);
ipsecVpn.getCandidateRemoteIpsecVpns().add(remote1);
IpsecVpnInfo vpnInfo = IpsecVpnStatusAnswerer.analyzeIpsecVpn(ipsecVpn);
assertThat(vpnInfo.getProblems(), equalTo(Collections.singleton(Problem.NONE)));
assertThat(vpnInfo.getRemoteEndpoint(), equalTo(new IpsecVpnEndpoint(remote1)));
}
use of org.batfish.datamodel.IpsecVpn in project batfish by batfish.
the class IpsecVpnStatusAnswererTest method analyzeVpnTestIncompatibleIkeProposal.
@Test
public void analyzeVpnTestIncompatibleIkeProposal() {
IpsecVpn ipsecVpn = createIpsecVpn("local", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
IpsecVpn remote1 = createIpsecVpn("remote1", IkeProposal.PSK_3DES_DH2_SHA1, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
ipsecVpn.initCandidateRemoteVpns();
ipsecVpn.setRemoteIpsecVpn(remote1);
ipsecVpn.getCandidateRemoteIpsecVpns().add(remote1);
IpsecVpnInfo vpnInfo = IpsecVpnStatusAnswerer.analyzeIpsecVpn(ipsecVpn);
assertThat(vpnInfo.getProblems(), equalTo(Collections.singleton(Problem.INCOMPATIBLE_IKE_PROPOSALS)));
assertThat(vpnInfo.getRemoteEndpoint(), equalTo(new IpsecVpnEndpoint(remote1)));
}
use of org.batfish.datamodel.IpsecVpn in project batfish by batfish.
the class IpsecVpnStatusAnswererTest method analyzeVpnTestMultipleProblems.
@Test
public void analyzeVpnTestMultipleProblems() {
IpsecVpn ipsecVpn = createIpsecVpn("local", IkeProposal.PSK_3DES_DH2_SHA1, IpsecProposal.NOPFS_ESP_DES_SHA, "key");
IpsecVpn remote1 = createIpsecVpn("remote1", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key-bad");
ipsecVpn.initCandidateRemoteVpns();
ipsecVpn.setRemoteIpsecVpn(remote1);
ipsecVpn.getCandidateRemoteIpsecVpns().add(remote1);
IpsecVpnInfo vpnInfo = IpsecVpnStatusAnswerer.analyzeIpsecVpn(ipsecVpn);
assertThat(vpnInfo.getProblems(), equalTo(Sets.newTreeSet(Arrays.asList(Problem.INCOMPATIBLE_IKE_PROPOSALS, Problem.INCOMPATIBLE_IPSEC_PROPOSALS, Problem.INCOMPATIBLE_PRE_SHARED_KEY))));
assertThat(vpnInfo.getRemoteEndpoint(), equalTo(new IpsecVpnEndpoint(remote1)));
}
use of org.batfish.datamodel.IpsecVpn in project batfish by batfish.
the class IpsecVpnStatusAnswererTest method analyzeVpnTestMultipleRemoteEndpoints.
@Test
public void analyzeVpnTestMultipleRemoteEndpoints() {
IpsecVpn ipsecVpn = createIpsecVpn("local", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
IpsecVpn remote1 = createIpsecVpn("remote1", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
IpsecVpn remote2 = createIpsecVpn("remote2", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
ipsecVpn.initCandidateRemoteVpns();
ipsecVpn.setRemoteIpsecVpn(remote1);
ipsecVpn.getCandidateRemoteIpsecVpns().add(remote1);
ipsecVpn.getCandidateRemoteIpsecVpns().add(remote2);
IpsecVpnInfo vpnInfo = IpsecVpnStatusAnswerer.analyzeIpsecVpn(ipsecVpn);
assertThat(vpnInfo.getProblems(), equalTo(Collections.singleton(Problem.MULTIPLE_REMOTE_ENDPOINTS)));
}
use of org.batfish.datamodel.IpsecVpn in project batfish by batfish.
the class IpsecVpnStatusAnswererTest method analyzeVpnTestMissingRemote.
@Test
public void analyzeVpnTestMissingRemote() {
IpsecVpn ipsecVpn = createIpsecVpn("local", IkeProposal.PSK_3DES_DH2_MD5, IpsecProposal.NOPFS_ESP_DES_MD5, "key");
IpsecVpnInfo vpnInfo = IpsecVpnStatusAnswerer.analyzeIpsecVpn(ipsecVpn);
assertThat(vpnInfo.getProblems(), equalTo(Collections.singleton(Problem.MISSING_REMOTE_ENDPOINT)));
}
Aggregations