Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. @Override
  2. public void test() throws Exception {
  3. SimpleTelnetClient client = new SimpleTelnetClient(getParameter("ip"), 33001); //$NON-NLS-1$
  4. client.connect();
  5.  
  6. client.send("\r\r");
  7. Thread.sleep(1000);
  8.  
  9. if(controller.getDeviceProfile().getSelectedModification().getFirmware() == null) {
  10. status = Test.Status.Fail;
  11. throw new Exception("Не задана версия прошивки");
  12. }
  13.  
  14. String txt = client.exchange("grep -r OpenWrt /etc/openwrt_release \r", "#", 3000);
  15. LOG.info(txt);
  16.  
  17. if(txt == null || !(txt.contains(controller.getDeviceProfile().getSelectedModification().getFirmware()))) {
  18. status = Test.Status.Fail;
  19. throw new Exception("Версия ОС не " + controller.getDeviceProfile().getSelectedModification().getFirmware());
  20. }
  21.  
  22. client.disconnect();
  23. status = Test.Status.Success;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement