Beispiel #1
0
 internal NetworkSettingsWindow(NetworkSettingsModel model)
 {
     this.model = model;
     InitializeComponent();
     DataContext = model;
     WebSocketPreSharedSecret.Password = model.WebSocketPreSharedSecret;
 }
Beispiel #2
0
        private void NetworkSettings_Click(object sender, RoutedEventArgs e)
        {
            NetworkSettingsModel model = new NetworkSettingsModel(this.model);

            model.SettingsUpdated += delegate
            {
                if (model.NetworkSinkDefaultsChanged)
                {
                    model.NetworkSinkDefaultsChanged = false;
                    foreach (SessionModel session in this.model.Sessions)
                    {
                        if (null != session.Settings.NetworkSink)
                        {
                            session.Settings.RestartPending = true;
                        }
                    }
                    sessions.RestartPending();
                }
                if (model.WebSocketEndpointChanged)
                {
                    model.WebSocketEndpointChanged = false;
                    wsListener.Settings            = this.model.Settings.WebSocketEndpoint;
                }
            };
            NetworkSettingsWindow nsWindow = new NetworkSettingsWindow(model)
            {
                Owner = this
            };

            nsWindow.ShowDialog();
        }
Beispiel #3
0
        public NetworkSettingsModel GetNetworkSettings(TestType testType)
        {
            List <NetworkSettingsModel> networkSettingsList = new List <NetworkSettingsModel>();

            networkSettingsList = GetNetworkSettingsList();
            NetworkSettingsModel networkSettings = networkSettingsList.Find(n => n.SettingName == testType.ToString());

            return(networkSettings);
        }
Beispiel #4
0
        public void StartTest()
        {
            Console.WriteLine("KernelStress running...");
            Thread.Sleep(1500);
            _fileService.RemoveShortcutFromStartup();

            ZTestSettingModel testSettingModel = new ZTestSettingModel();

            testSettingModel = _xmlService.GetZTestSetting(TestType.KernelStressTest);
            string KSKfilePath = testSettingModel.TestFileFullPath;

            NetworkSettingsModel networkSetting = _xmlService.GetNetworkSettings(TestType.KernelStressTest);

            bool result = _remoteConnectionService.MapDrive("M", KSKfilePath, networkSetting.Domain + @"\" + networkSetting.UserName, networkSetting.Password);

            if (result)
            {
                Console.WriteLine("cmd.exe", @"/c M:\ksk.cmd");
                Process.Start("cmd.exe", @"/c M:\ksk.cmd");
            }
        }
Beispiel #5
0
        public void StartTest()
        {
            Console.WriteLine("SlelepTest running...");
            Thread.Sleep(1500);

            if (_fileService.IsShortcutOfRebootLoopExists)
            {
                _fileService.RemoveShortcutFromStartup();
            }

            _cmdService.RunCMDCommand("https://www.youtube.com/watch?v=_U24PBWOpjM", fileName: "iexplore.exe", waitForExit: false);
            Thread.Sleep(30000);

            _cmdService.RunCMDCommand("https://www.youtube.com/watch?v=jj_Mei27E7Q", fileName: "iexplore.exe", waitForExit: false);
            Thread.Sleep(30000);

            _cmdService.RunCMDCommand("https://www.youtube.com/watch?v=5TcOvHigjYE", fileName: "iexplore.exe", waitForExit: false);
            Thread.Sleep(30000);


            ZTestSettingModel testSettingModel = new ZTestSettingModel();

            testSettingModel = _xmlService.GetZTestSetting(TestType.SleepTest);
            string TestfilePath = testSettingModel.TestFileFullPath;

            NetworkSettingsModel networkSetting = _xmlService.GetNetworkSettings(TestType.KernelStressTest);

            if (TestfilePath == null || TestfilePath == "")
            {
                Console.WriteLine("The TestFileFullPath property does not setted, please open ZTester.config file and set TestFileLocation for SleepTest section");
                return;
            }

            bool result = _remoteConnectionService.MapDrive("M", networkSetting.TestFileLocation, networkSetting.Domain + @"\" + networkSetting.UserName, networkSetting.Password);



            string systemDrive          = _fileService.GetPathRoot(Environment.SystemDirectory);
            string testBinPath          = systemDrive + "TestBin";
            bool   isTestBinExist       = _fileService.CheckIfDirectoryExists(testBinPath);
            bool   isSleepTestFileExist = false;

            if (!isTestBinExist)
            {
                _fileService.CreateDirectory(Constants.TestBinPath);
                Process.Start("cmd.exe", @"/c xcopy M:\pwrtest.exe c:\TestBin\* /s /y");
            }
            else
            {
                isSleepTestFileExist = _fileService.CheckIfFileExists(testBinPath);
                if (!isSleepTestFileExist)
                {
                    Process.Start("cmd.exe", @"/c xcopy M:\pwrtest.exe c:\TestBin\* /s /y");
                }
            }



            Thread.Sleep(30000);

            _cmdService.RunCMDCommand("/sleep /c:4 /p:120 /d:150 /s:all", "pwrtest.exe", testBinPath);

            FinishTest();
        }