could reproduce Problem with sw packages
| | |
| | | INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number) |
| | | SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false, 103 FROM basepacket, basecomponent WHERE basepacket_code='PAC/DW' AND basecomponent_code='DAEMON'; |
| | | INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number) |
| | | SELECT basepacket_id, basecomponent_id, 0, 0, 0, 1, 0, false, 203 FROM basepacket, basecomponent WHERE basepacket_code='PAC/SW' AND basecomponent_code='DAEMON'; |
| | | INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number) |
| | | SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false, 303 FROM basepacket, basecomponent WHERE basepacket_code='PAC/WEB' AND basecomponent_code='DAEMON'; |
| | | INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number) |
| | | SELECT basepacket_id, basecomponent_id, 0, 1, 1, 1, 1, false, 104 FROM basepacket, basecomponent WHERE basepacket_code='PAC/DW' AND basecomponent_code='MIRROR'; |
| | |
| | | for (PacComponent pc : newPacComponents) { |
| | | BaseComponent bc = pc.getBaseComponent(); |
| | | String feature = bc.getFeature(); |
| | | int quantity = oldQuantities.get(feature).intValue(); |
| | | Integer oldQuantity = oldQuantities.get(feature); |
| | | int quantity = 0; |
| | | if (oldQuantity != null) { |
| | | quantity = oldQuantity.intValue(); |
| | | } |
| | | int increment = newBasepac.getComponent(feature).getIncrementQuantity(); |
| | | if (quantity % increment != 0) { |
| | | int numOfIncrements = quantity / increment; |
| | |
| | | try { |
| | | Object execute = client.execute(PAC_MODULE + ".add", params); |
| | | assertTrue(execute instanceof Map<?, ?>); |
| | | try { // wait for pac creation |
| | | Thread.sleep(10000L); |
| | | } catch (InterruptedException e) { |
| | | } |
| | | cas.setPassword(client, "aaa00"); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Object execute = addPac(user, grantingTicketURL, |
| | | "aaa05", BasePacType.PAC_SW, "176.9.242.77", |
| | | 1024, 8, 0); |
| | | 1024, 8, -1); |
| | | assertEquals(count + 1, getPacsCount()); |
| | | validateAddedPac(execute, BasePacType.PAC_SW, 1024, 8, -1); |
| | | setPacAdminPassword(user, grantingTicketURL, "aaa05", "test123"); |
| | |
| | | HashMap<String, String> components = new HashMap<String, String>(); |
| | | components.put("QUOTA", Integer.toString(quota)); |
| | | components.put("TRAFFIC", Integer.toString(traffic)); |
| | | components.put("DAEMON", Integer.toString(daemons)); |
| | | if (daemons >= 0) { |
| | | components.put("DAEMON", Integer.toString(daemons)); |
| | | } |
| | | setParams.put("components", components); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), |