@Override public boolean apply(OperatingSystem os) { if (os.getFamily() != null) { switch (os.getFamily()) { case DEBIAN: case UBUNTU: return true; } } for (String toMatch : searchStrings(os)) if (toMatch != null && (toMatch.toLowerCase().indexOf("ubuntu") != -1 || toMatch.toLowerCase().indexOf("debian") != -1)) return true; return false; }
public static Statement installJavaAndCurl(OperatingSystem os) { if (os == null || OperatingSystemPredicates.supportsApt().apply(os)) return APT_RUN_SCRIPT; else if (OperatingSystemPredicates.supportsYum().apply(os)) return YUM_RUN_SCRIPT; else if (OperatingSystemPredicates.supportsZypper().apply(os)) return ZYPPER_RUN_SCRIPT; else throw new IllegalArgumentException("don't know how to handle" + os.toString()); }
public void testCIMCENTOSSupportsYum() { assert supportsYum().apply(new CIMOperatingSystem(OSType.CENTOS, "", null, "description")); assert supportsYum().apply(new CIMOperatingSystem(OSType.CENTOS_64, "", null, "description")); }
public void testCIMUBUNTUSupportsApt() { assert supportsApt().apply(new CIMOperatingSystem(OSType.UBUNTU, "", null, "description")); assert supportsApt().apply(new CIMOperatingSystem(OSType.UBUNTU_64, "", null, "description")); }
public void testSuseNameSupportsZypper() { assert supportsZypper().apply(new OperatingSystem(null, "Suse", "", null, "description", false)); }
public void testCIMRHELSupportsYum() { assert supportsYum().apply(new CIMOperatingSystem(OSType.RHEL, "", null, "description")); assert supportsYum().apply(new CIMOperatingSystem(OSType.RHEL_64, "", null, "description")); }
public void testCIMDEBIANSupportsApt() { assert supportsApt().apply(new CIMOperatingSystem(OSType.DEBIAN, "", null, "description")); assert supportsApt().apply(new CIMOperatingSystem(OSType.DEBIAN_64, "", null, "description")); }
public void testSuseTypeSupportsZypper() { assert supportsZypper().apply(new OperatingSystem(OsFamily.SUSE, null, "", null, "description", false)); }
public void testCIMDEBIANDoesntSupportYum() { assert !supportsYum().apply(new CIMOperatingSystem(OSType.DEBIAN, "", null, "description")); assert !supportsYum().apply(new CIMOperatingSystem(OSType.DEBIAN_64, "", null, "description")); }
@Override public boolean apply(OperatingSystem os) { if (os.getFamily() != null) { switch (os.getFamily()) { case SUSE: return true; } } for (String toMatch : searchStrings(os)) if (toMatch != null && toMatch.toLowerCase().indexOf("suse") != -1) return true; return false; }
public void testCIMCENTOSDoesntSupportApt() { assert !supportsApt().apply(new CIMOperatingSystem(OSType.CENTOS, "", null, "description")); assert !supportsApt().apply(new CIMOperatingSystem(OSType.CENTOS_64, "", null, "description")); }
public void testSuseDescriptionSupportsZypper() { assert supportsZypper().apply(new OperatingSystem(null, "", null, null, "Suse", false)); }
public void testRedHatEnterpriseLinuxDescriptionSupportsYum() { assert supportsYum().apply(new OperatingSystem(null, "", null, null, "Red Hat Enterprise Linux", false)); } }
@Override public boolean apply(OperatingSystem os) { if (os.getFamily() != null) { switch (os.getFamily()) { case CENTOS: case AMZN_LINUX: case FEDORA: case RHEL: return true; } } for (String toMatch : searchStrings(os)) if (toMatch.toLowerCase().indexOf("centos") != -1 || toMatch.toLowerCase().indexOf("rhel") != -1 || toMatch.toLowerCase().replace(" ", "").indexOf("redhate") != -1 || toMatch.toLowerCase().indexOf("fedora") != -1) return true; return false; }
public void testCIMRHELDoesntSupportApt() { assert !supportsApt().apply(new CIMOperatingSystem(OSType.RHEL, "", null, "description")); assert !supportsApt().apply(new CIMOperatingSystem(OSType.RHEL_64, "", null, "description")); }
public void testSuseTypeSupportsZypper() { assert supportsZypper().apply(new OperatingSystem(OsFamily.SUSE, null, "", null, "description", false)); }
public void testCIMUBUNTUDoesntSupportYum() { assert !supportsYum().apply(new CIMOperatingSystem(OSType.UBUNTU, "", null, "description")); assert !supportsYum().apply(new CIMOperatingSystem(OSType.UBUNTU_64, "", null, "description")); }
@Override public boolean apply(OperatingSystem os) { if (os.getFamily() != null) { switch (os.getFamily()) { case DEBIAN: case UBUNTU: return true; } } for (String toMatch : searchStrings(os)) if (toMatch != null && (toMatch.toLowerCase().indexOf("ubuntu") != -1 || toMatch.toLowerCase().indexOf("debian") != -1)) return true; return false; }
public void testUbuntuNameSupportsApt() { assert supportsApt().apply(new OperatingSystem(null, "Ubuntu", "", null, "description", false)); }
public void testSuseDescriptionSupportsZypper() { assert supportsZypper().apply(new OperatingSystem(null, "", null, null, "Suse", false)); }