Guest User

Untitled

a guest
Feb 1st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. from subprocess import Popen, CREATE_NEW_CONSOLE,PIPE,STDOUT
  2. import time
  3. import subprocess
  4. import datetime
  5. import os
  6. #import envSI
  7.  
  8. class Wiresharking:
  9.  
  10. """Wireshark Server subclass"""
  11.  
  12. def __init__(self,**kwargs):
  13.  
  14. self.filters=''
  15. self.window_ip = kwargs.get('ip')
  16. print type(self.window_ip)
  17. self.window_user= kwargs.get('username')
  18. self.window_password= kwargs.get('password')
  19. self.dest_path= kwargs.get('Target_path')
  20. self.interface= kwargs.get('interface')
  21. self.terminal='cmd'
  22. self.home=kwargs.get('Home_path')
  23.  
  24.  
  25. def test(self):
  26. print 'hi'
  27. return self.window_ip
  28.  
  29. SERVER_01 = Wiresharking(
  30. name='WIRESHARK_ENV91',
  31. ip='192.168.1.16',
  32. username=r'NSN-INTRArechandr', #always prepend r , before giving your username and password
  33. password='jan@2018',
  34. prompt='$ ',
  35. autostart=False,
  36. unzip_capture=True,
  37. filter='',
  38. #interface=['ens2f0'],
  39. interface='Ethernet',
  40. Target_path=r'D:Userspankaj-mDesktopTest'
  41. )
  42.  
  43. print SERVER_01.test()
  44.  
  45. <type 'str'>
  46. hi
  47. 192.168.1.16
  48.  
  49. pybot -V env.py Check.robot
  50.  
  51. *** Settings ***
  52. Library Wiresharking.py
  53. *** Test Cases ***
  54. Test
  55. check
  56. *** Keywords ***
  57. check
  58. ${abc} = test
  59. log ${abc}
  60.  
  61. 16:13:37.279 INFO None
Add Comment
Please, Sign In to add comment