mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 22:48:20 +01:00
- 128 triggers a server shutdown. - 129 and 130 are identical to SIGUSR1 and SIGUSR2 respectively, triggering a graceful shutdown and detaching shutdown respectively. - These are implemented via pipes and are preferred to using the update path going forward. Should eventually replace the param entirely at the next possibility. - New service params to detach and restart any running server as opposed to stopping entirely. - Defer all service control to Service executable from Configure app. - Console runner returns non-zero on error. - Fix setting ACL of appsettings.Production.yml.
30 lines
929 B
C#
30 lines
929 B
C#
using Microsoft.Extensions.Logging;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using Moq;
|
|
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
using Tgstation.Server.Host.Watchdog;
|
|
|
|
namespace Tgstation.Server.Host.Console.Tests
|
|
{
|
|
[TestClass]
|
|
public class TestProgram
|
|
{
|
|
[TestMethod]
|
|
public async Task TestProgramRuns()
|
|
{
|
|
var mockServer = new Mock<IWatchdog>();
|
|
var args = Array.Empty<string>();
|
|
mockServer.Setup(x => x.RunAsync(false, args, It.IsAny<CancellationToken>())).Returns(Task.FromResult(true)).Verifiable();
|
|
var mockServerFactory = new Mock<IWatchdogFactory>();
|
|
mockServerFactory.Setup(x => x.CreateWatchdog(It.IsNotNull<ISignalChecker>(), It.IsNotNull<ILoggerFactory>())).Returns(mockServer.Object).Verifiable();
|
|
Program.WatchdogFactory = mockServerFactory.Object;
|
|
await Program.Main(args);
|
|
mockServer.VerifyAll();
|
|
mockServerFactory.VerifyAll();
|
|
}
|
|
}
|
|
}
|