Exemple #1
0
        public void AssertSystemctlServiceIsRunning(string serviceName)
        {
            Console.WriteLine("  Asserting systemctl service is running...");

            Console.WriteLine("    Is mock systemctl: " + (this.SystemCtl.GetType().Name.IndexOf("Mock") > -1));

            var output = SystemCtl.StatusReport(serviceName);

            AssertTextContains(output, "active (running)", "Systemctl service is not running: " + serviceName);

            /*
             * var mockSystemctlFile = Context.IndexDirectory + "/is-mock-systemctl.txt";
             *
             * var isMockSystemCtl = File.Exists(mockSystemctlFile) || Context.Settings.IsMockSystemCtl;
             *
             * Console.WriteLine("  Mock flag file exists: " + File.Exists(mockSystemctlFile));
             * Console.WriteLine("  Mock setting: " + Context.Settings.IsMockSystemCtl);
             * Console.WriteLine("  Is mock systemctl:" + isMockSystemCtl);
             *
             * if (isMockSystemCtl)
             * {
             * var cmd = "systemctl status " + serviceName.Replace(".service", "") + ".service";
             *
             * Starter.StartBash(cmd);
             *
             * var output = Starter.Output;
             *
             * AssertTextContains(output, "active (running)", "Systemctl service is not running: " + serviceName);
             * }*/
        }
Exemple #2
0
        public void VerifyServiceIsRunning()
        {
            Console.WriteLine("Verifying Arduino Plug and Play service is running...");

            //var mockSystemctlFile = GetInstallPath() + "/is-mock-systemctl.txt";

            //if (!File.Exists(mockSystemctlFile))
            //{
            //var cmd =

            //Starter.StartBash(cmd);

            var output = SystemCtl.StatusReport("arduino-plug-and-play");

            AssertTextContains(output, "active (running)", "Arduino plug and play service is not running.");
            //}
        }