From 4c846014350bb0d3ecc0be4dc2ea7b455faa446c Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 16 Oct 2023 21:31:26 -0400 Subject: [PATCH 1/8] Fix DMAPI not returning a value for world.TgsSecurityLevel() --- build/Version.props | 2 +- src/DMAPI/tgs.dm | 2 +- src/DMAPI/tgs/core/core.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Version.props b/build/Version.props index 6a908f98fd..ef2f652396 100644 --- a/build/Version.props +++ b/build/Version.props @@ -9,7 +9,7 @@ 6.0.1 11.1.2 12.1.2 - 6.5.3 + 6.5.4 5.6.1 1.4.0 1.2.1 diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index 6187a67825..d0466b806f 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "6.5.3" +#define TGS_DMAPI_VERSION "6.5.4" // All functions and datums outside this document are subject to change with any version and should not be relied on. diff --git a/src/DMAPI/tgs/core/core.dm b/src/DMAPI/tgs/core/core.dm index 41a0473394..aa4084904b 100644 --- a/src/DMAPI/tgs/core/core.dm +++ b/src/DMAPI/tgs/core/core.dm @@ -153,4 +153,4 @@ /world/TgsSecurityLevel() var/datum/tgs_api/api = TGS_READ_GLOBAL(tgs) if(api) - api.SecurityLevel() + return api.SecurityLevel() From c8984cc109134062e7e5546d7ea5eb450d420cd2 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 16 Oct 2023 21:59:41 -0400 Subject: [PATCH 2/8] Fix a log message typo --- src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs index 47a67728ab..7595a70a43 100644 --- a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs +++ b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs @@ -153,7 +153,7 @@ namespace Tgstation.Server.Host.Utils.GitHub rateLimitInfo.Reset.ToString("o")); else logger.LogDebug( - "Requested GitHub client has {remainingRequests} requests remaining after the usage {lastUse}. Limit resets at {resetTime}", + "Requested GitHub client has {remainingRequests} requests remaining after the usage at {lastUse}. Limit resets at {resetTime}", rateLimitInfo.Remaining, lastUsed, rateLimitInfo.Reset.ToString("o")); From 8a5d0d40e585a3d19a2d51979cab76fa14b24816 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 16 Oct 2023 21:59:44 -0400 Subject: [PATCH 3/8] Test DMAPI security level and CWD is Live --- tests/DMAPI/LongRunning/Test.dm | 26 +++++++ .../LongRunning/long_running_test_rooted.dme | 17 +++++ .../Live/Instance/ConfigurationTest.cs | 10 ++- .../Live/Instance/InstanceTest.cs | 3 +- .../Live/Instance/WatchdogTest.cs | 68 ++++++++++++++++++- tgstation-server.sln | 1 + 6 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 tests/DMAPI/LongRunning/long_running_test_rooted.dme diff --git a/tests/DMAPI/LongRunning/Test.dm b/tests/DMAPI/LongRunning/Test.dm index bed428eceb..d3515034ee 100644 --- a/tests/DMAPI/LongRunning/Test.dm +++ b/tests/DMAPI/LongRunning/Test.dm @@ -11,6 +11,12 @@ dab() TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_SAFE) + var/sec = TgsSecurityLevel() + if(isnull(sec)) + FailTest("TGS Security level was null!") + + log << "Running in security level: [sec]" + if(params["expect_chat_channels"]) var/list/channels = TgsChatChannelInfo() if(!length(channels)) @@ -140,6 +146,26 @@ var/run_bridge_test kajigger_test = TRUE return "we love casting spells" + var/expected_path = data["vaporeon"] + if(expected_path) + var/command + if(world.system_type == MS_WINDOWS) + command = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -Command \"if('[expected_path]' -ne $(Get-Location)){ (Get-Location).Path | Out-File \"fuck_up.txt\"; exit 1; }\"" + else + command = "if \[\[ \"[expected_path]\" != \"$(pwd)\" \]\]; then echo $(pwd) > fuck_up.txt; exit 1; fi" + + world.log << "shell: [command]" + var/exitCode = shell(command) + + if(isnull(exitCode) || exitCode != 0) + var/fuck_up_reason = "DIDN'T READ" + if(fexists("fuck_up.txt")) + fuck_up_reason = "COULDN'T READ" + fuck_up_reason = file2text("fuck_up.txt") + return "Dir check shell command failed with code [exitCode || "null"]: [fuck_up_reason]" + + return "is the most pokemon of all time" + TgsChatBroadcast(new /datum/tgs_message_content("Recieved non-tgs topic: `[T]`")) return "feck" diff --git a/tests/DMAPI/LongRunning/long_running_test_rooted.dme b/tests/DMAPI/LongRunning/long_running_test_rooted.dme new file mode 100644 index 0000000000..d8e9d61c96 --- /dev/null +++ b/tests/DMAPI/LongRunning/long_running_test_rooted.dme @@ -0,0 +1,17 @@ +// Hand crafted DME, will not work if saved with DreamMaker + +// BEGIN_INTERNALS +// END_INTERNALS + +// BEGIN_FILE_DIR +#define FILE_DIR . +// END_FILE_DIR + +// BEGIN_PREFERENCES +// END_PREFERENCES + +// BEGIN_INCLUDE +#include "tests/DMAPI/LongRunning/Config.dm" +#include "tests/DMAPI/test_prelude.dm" +#include "tests/DMAPI/LongRunning/Test.dm" +// END_INCLUDE diff --git a/tests/Tgstation.Server.Tests/Live/Instance/ConfigurationTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/ConfigurationTest.cs index 1008406cd7..2dea3e5b12 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/ConfigurationTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/ConfigurationTest.cs @@ -92,7 +92,7 @@ namespace Tgstation.Server.Tests.Live.Instance await configurationClient.CreateDirectory(staticDir, cancellationToken); } - public Task SetupDMApiTests(CancellationToken cancellationToken) + public Task SetupDMApiTests(bool includingRoot, CancellationToken cancellationToken) { // just use an I/O manager here var ioManager = new DefaultIOManager(); @@ -104,6 +104,12 @@ namespace Tgstation.Server.Tests.Live.Instance ioManager.ConcatPath(instance.Path, "Repository", "tests", "DMAPI"), null, cancellationToken), + includingRoot + ? ioManager.CopyFile( + "../../../../DMAPI/LongRunning/long_running_test_rooted.dme", + ioManager.ConcatPath(instance.Path, "Repository", "long_running_test_rooted.dme"), + cancellationToken) + : Task.CompletedTask, ioManager.CopyDirectory( Enumerable.Empty(), null, @@ -175,8 +181,8 @@ namespace Tgstation.Server.Tests.Live.Instance } public Task RunPreWatchdog(CancellationToken cancellationToken) => Task.WhenAll( + SetupDMApiTests(false, cancellationToken), SequencedApiTests(cancellationToken), - SetupDMApiTests(cancellationToken), TestPregeneratedFilesExist(cancellationToken)); } } diff --git a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs index 9265e0e7f6..4457994d79 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs @@ -63,6 +63,7 @@ namespace Tgstation.Server.Tests.Live.Instance await chatTask; await dmTask; + await configTest.SetupDMApiTests(true, cancellationToken); await byondTask; await new WatchdogTest( @@ -172,7 +173,7 @@ namespace Tgstation.Server.Tests.Live.Instance dmUpdateRequest, cloneRequest); - var configSetupTask = new ConfigurationTest(instanceClient.Configuration, instanceClient.Metadata).SetupDMApiTests(cancellationToken); + var configSetupTask = new ConfigurationTest(instanceClient.Configuration, instanceClient.Metadata).SetupDMApiTests(true, cancellationToken); if (TestingUtils.RunningInGitHubActions || String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS_TEST_GITHUB_TOKEN")) diff --git a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs index 641085529c..bd1671e05e 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs @@ -131,6 +131,8 @@ namespace Tgstation.Server.Tests.Live.Instance await RunLongRunningTestThenUpdate(cancellationToken); + await TestDDIsntResolvingSymlink(cancellationToken); + await RunLongRunningTestThenUpdateWithNewDme(cancellationToken); await RunLongRunningTestThenUpdateWithByondVersionSwitch(cancellationToken); @@ -150,6 +152,70 @@ namespace Tgstation.Server.Tests.Live.Instance System.Console.WriteLine($"TEST: END WATCHDOG TESTS {instanceClient.Metadata.Name}"); } + async ValueTask TestDDIsntResolvingSymlink(CancellationToken cancellationToken) + { + System.Console.WriteLine("STARTING SYMLINK RESOLVE TEST"); + var deployTask = DeployTestDme("long_running_test_rooted", DreamDaemonSecurity.Trusted, true, cancellationToken); + + var previous = await instanceClient.DreamDaemon.Read(cancellationToken); + if (previous.SecurityLevel.Value != DreamDaemonSecurity.Trusted) + { + var updated = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest + { + SecurityLevel = DreamDaemonSecurity.Trusted + }, cancellationToken); + + Assert.AreEqual(DreamDaemonSecurity.Trusted, updated.SecurityLevel); + } + + var startState = await deployTask; + + await WaitForJob(await StartDD(cancellationToken), 30, false, null, cancellationToken); + + var command = topicClient.SanitizeString( + Path.GetFullPath( + Path.Combine( + instanceClient.Metadata.Path, + "Game", + "Live"))); + command = $"vaporeon={command}"; + + var topicRequestResult = await topicClient.SendTopic( + IPAddress.Loopback, + command, + ddPort, + cancellationToken); + + Assert.IsNotNull(topicRequestResult); + Assert.AreEqual("is the most pokemon of all time", topicRequestResult.StringData); + + await DeployTestDme("long_running_test_rooted", DreamDaemonSecurity.Trusted, true, cancellationToken); + var newState = await TellWorldToReboot(cancellationToken); + + Assert.AreNotEqual(startState.ActiveCompileJob.Id, newState.ActiveCompileJob.Id); + topicRequestResult = await topicClient.SendTopic( + IPAddress.Loopback, + command, + ddPort, + cancellationToken); + + Assert.IsNotNull(topicRequestResult); + Assert.AreEqual("is the most pokemon of all time", topicRequestResult.StringData); + + await instanceClient.DreamDaemon.Shutdown(cancellationToken); + if (previous.SecurityLevel.Value != DreamDaemonSecurity.Trusted) + { + var updated = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest + { + SecurityLevel = previous.SecurityLevel + }, cancellationToken); + + Assert.AreEqual(previous.SecurityLevel, updated.SecurityLevel); + } + + System.Console.WriteLine("END SYMLINK RESOLVE TEST"); + } + async Task InteropTestsForLongRunningDme(CancellationToken cancellationToken) { await StartAndLeaveRunning(cancellationToken); @@ -1101,7 +1167,7 @@ namespace Tgstation.Server.Tests.Live.Instance var refreshed = await instanceClient.DreamMaker.Update(new DreamMakerRequest { ApiValidationSecurityLevel = deploymentSecurity, - ProjectName = $"tests/DMAPI/{dmeName}", + ProjectName = dmeName.Contains("rooted") ? dmeName : $"tests/DMAPI/{dmeName}", RequireDMApiValidation = requireApi, Timeout = TimeSpan.FromMilliseconds(1), }, cancellationToken); diff --git a/tgstation-server.sln b/tgstation-server.sln index 6d183435b8..20eef245e1 100644 --- a/tgstation-server.sln +++ b/tgstation-server.sln @@ -157,6 +157,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LongRunning", "LongRunning" tests\DMAPI\LongRunning\Config.dm = tests\DMAPI\LongRunning\Config.dm tests\DMAPI\LongRunning\long_running_test.dme = tests\DMAPI\LongRunning\long_running_test.dme tests\DMAPI\LongRunning\long_running_test_copy.dme = tests\DMAPI\LongRunning\long_running_test_copy.dme + tests\DMAPI\LongRunning\long_running_test_rooted.dme = tests\DMAPI\LongRunning\long_running_test_rooted.dme tests\DMAPI\LongRunning\Test.dm = tests\DMAPI\LongRunning\Test.dm EndProjectSection EndProject From 2f5e62c9a011b591d59860613e93fc50cb9ff4f4 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 20 Oct 2023 23:30:39 -0400 Subject: [PATCH 4/8] A note to help future errors on this assert --- tests/Tgstation.Server.Tests/Live/TestLiveServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs index 5a7da4471a..f058d9795f 100644 --- a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs +++ b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs @@ -1471,7 +1471,7 @@ namespace Tgstation.Server.Tests.Live await WatchdogTest.TellWorldToReboot2(instanceClient, WatchdogTest.StaticTopicClient, mainDDPort, cancellationToken); dd = await instanceClient.DreamDaemon.Read(cancellationToken); - Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value); + Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value); // if this assert fails, you likely have to crack open the debugger and read test_fail_reason.txt manually Assert.IsNull(dd.StagedCompileJob); Assert.AreEqual(initialStaged, dd.ActiveCompileJob.Id); From a6cb81902fe075f0f7361bc433db3c1a0be8c2d0 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 20 Oct 2023 23:44:44 -0400 Subject: [PATCH 5/8] Fix RuntimeInformation after reattach having null SecurityLevel and Visibility --- build/Version.props | 2 +- src/DMAPI/tgs/v5/__interop_version.dm | 2 +- .../Components/Interop/Bridge/RuntimeInformation.cs | 12 ++++++++---- .../Components/Session/ReattachInformation.cs | 6 ++---- .../Components/Session/SessionControllerFactory.cs | 13 ++++++++----- .../Models/ReattachInformationBase.cs | 4 ++-- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/build/Version.props b/build/Version.props index ef2f652396..4a4c556f24 100644 --- a/build/Version.props +++ b/build/Version.props @@ -10,7 +10,7 @@ 11.1.2 12.1.2 6.5.4 - 5.6.1 + 5.6.2 1.4.0 1.2.1 1.0.2 diff --git a/src/DMAPI/tgs/v5/__interop_version.dm b/src/DMAPI/tgs/v5/__interop_version.dm index 5d3d491a73..1b52b31d6a 100644 --- a/src/DMAPI/tgs/v5/__interop_version.dm +++ b/src/DMAPI/tgs/v5/__interop_version.dm @@ -1 +1 @@ -"5.6.1" +"5.6.2" diff --git a/src/Tgstation.Server.Host/Components/Interop/Bridge/RuntimeInformation.cs b/src/Tgstation.Server.Host/Components/Interop/Bridge/RuntimeInformation.cs index 5d0d13b7fa..b7d05b67d7 100644 --- a/src/Tgstation.Server.Host/Components/Interop/Bridge/RuntimeInformation.cs +++ b/src/Tgstation.Server.Host/Components/Interop/Bridge/RuntimeInformation.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; +using Newtonsoft.Json; + using Tgstation.Server.Api.Models; using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Deployment; @@ -42,12 +44,14 @@ namespace Tgstation.Server.Host.Components.Interop.Bridge /// /// The level of the launch. /// - public DreamDaemonSecurity? SecurityLevel { get; } + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] + public DreamDaemonSecurity SecurityLevel { get; } /// /// The level of the launch. /// - public DreamDaemonVisibility? Visibility { get; } + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] + public DreamDaemonVisibility Visibility { get; } /// /// The s in the launch. @@ -70,8 +74,8 @@ namespace Tgstation.Server.Host.Components.Interop.Bridge IDmbProvider dmbProvider, Version serverVersion, string instanceName, - DreamDaemonSecurity? securityLevel, - DreamDaemonVisibility? visibility, + DreamDaemonSecurity securityLevel, + DreamDaemonVisibility visibility, ushort serverPort, bool apiValidateOnly) : base(chatTrackingContext?.Channels ?? throw new ArgumentNullException(nameof(chatTrackingContext))) diff --git a/src/Tgstation.Server.Host/Components/Session/ReattachInformation.cs b/src/Tgstation.Server.Host/Components/Session/ReattachInformation.cs index 2c9007f4f3..6c429d2d0a 100644 --- a/src/Tgstation.Server.Host/Components/Session/ReattachInformation.cs +++ b/src/Tgstation.Server.Host/Components/Session/ReattachInformation.cs @@ -76,13 +76,11 @@ namespace Tgstation.Server.Host.Components.Session Dmb = dmb ?? throw new ArgumentNullException(nameof(dmb)); ProcessId = process?.Id ?? throw new ArgumentNullException(nameof(process)); RuntimeInformation = runtimeInformation ?? throw new ArgumentNullException(nameof(runtimeInformation)); - if (!runtimeInformation.SecurityLevel.HasValue) - throw new ArgumentException("runtimeInformation must have a valid SecurityLevel!", nameof(runtimeInformation)); AccessIdentifier = accessIdentifier ?? throw new ArgumentNullException(nameof(accessIdentifier)); - LaunchSecurityLevel = runtimeInformation.SecurityLevel.Value; - LaunchVisibility = runtimeInformation.Visibility.Value; + LaunchSecurityLevel = runtimeInformation.SecurityLevel; + LaunchVisibility = runtimeInformation.Visibility; Port = port; runtimeInformationLock = new object(); diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs index 96228c3c32..939632524a 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs @@ -336,7 +336,8 @@ namespace Tgstation.Server.Host.Components.Session var runtimeInformation = CreateRuntimeInformation( dmbProvider, chatTrackingContext, - launchParameters, + launchParameters.SecurityLevel.Value, + launchParameters.Visibility.Value, apiValidate); var reattachInformation = new ReattachInformation( @@ -430,7 +431,8 @@ namespace Tgstation.Server.Host.Components.Session var runtimeInformation = CreateRuntimeInformation( reattachInformation.Dmb, chatTrackingContext, - null, + reattachInformation.LaunchSecurityLevel, + reattachInformation.LaunchVisibility, false); reattachInformation.SetRuntimeInformation(runtimeInformation); @@ -632,15 +634,16 @@ namespace Tgstation.Server.Host.Components.Session RuntimeInformation CreateRuntimeInformation( IDmbProvider dmbProvider, IChatTrackingContext chatTrackingContext, - DreamDaemonLaunchParameters launchParameters, + DreamDaemonSecurity securityLevel, + DreamDaemonVisibility visibility, bool apiValidateOnly) => new ( chatTrackingContext, dmbProvider, assemblyInformationProvider.Version, instance.Name, - launchParameters?.SecurityLevel, - launchParameters?.Visibility, + securityLevel, + visibility, serverPortProvider.HttpApiPort, apiValidateOnly); diff --git a/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs b/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs index 76dfbfda36..5cad9efbce 100644 --- a/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs +++ b/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs @@ -32,13 +32,13 @@ namespace Tgstation.Server.Host.Models /// The level DreamDaemon was launched with. /// [Required] - public DreamDaemonSecurity? LaunchSecurityLevel { get; set; } + public DreamDaemonSecurity LaunchSecurityLevel { get; set; } /// /// The DreamDaemon was launched with. /// [Required] - public DreamDaemonVisibility? LaunchVisibility { get; set; } + public DreamDaemonVisibility LaunchVisibility { get; set; } /// /// Initializes a new instance of the class. From 6ab9fc51fcd68b908eabd945d8695ad4e8c5f813 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 21 Oct 2023 00:16:36 -0400 Subject: [PATCH 6/8] Remove unnecessary `RequiredAttribute`s --- src/Tgstation.Server.Host/Models/ReattachInformationBase.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs b/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs index 5cad9efbce..241fae5141 100644 --- a/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs +++ b/src/Tgstation.Server.Host/Models/ReattachInformationBase.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel.DataAnnotations; using System.Globalization; using Tgstation.Server.Api.Models; @@ -31,13 +30,11 @@ namespace Tgstation.Server.Host.Models /// /// The level DreamDaemon was launched with. /// - [Required] public DreamDaemonSecurity LaunchSecurityLevel { get; set; } /// /// The DreamDaemon was launched with. /// - [Required] public DreamDaemonVisibility LaunchVisibility { get; set; } /// From 42b09376d2d90f783452814333dc6c2bec08ef2a Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 21 Oct 2023 00:18:30 -0400 Subject: [PATCH 7/8] Fix documentation comment errors --- .../Components/Session/SessionControllerFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs index 939632524a..cf0dea0468 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs @@ -628,7 +628,8 @@ namespace Tgstation.Server.Host.Components.Session /// /// The . /// The . - /// The if any. + /// The the server was launched with. + /// The the server was launched with. /// The value of . /// A new class. RuntimeInformation CreateRuntimeInformation( From 279671c7cbd8d2e5ea184e2461c42af14b2b11df Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 21 Oct 2023 03:49:28 -0400 Subject: [PATCH 8/8] Remove failing and badly conceived test --- tests/DMAPI/LongRunning/Test.dm | 20 ------ .../Live/Instance/WatchdogTest.cs | 66 ------------------- 2 files changed, 86 deletions(-) diff --git a/tests/DMAPI/LongRunning/Test.dm b/tests/DMAPI/LongRunning/Test.dm index d3515034ee..a77c3377b5 100644 --- a/tests/DMAPI/LongRunning/Test.dm +++ b/tests/DMAPI/LongRunning/Test.dm @@ -146,26 +146,6 @@ var/run_bridge_test kajigger_test = TRUE return "we love casting spells" - var/expected_path = data["vaporeon"] - if(expected_path) - var/command - if(world.system_type == MS_WINDOWS) - command = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -Command \"if('[expected_path]' -ne $(Get-Location)){ (Get-Location).Path | Out-File \"fuck_up.txt\"; exit 1; }\"" - else - command = "if \[\[ \"[expected_path]\" != \"$(pwd)\" \]\]; then echo $(pwd) > fuck_up.txt; exit 1; fi" - - world.log << "shell: [command]" - var/exitCode = shell(command) - - if(isnull(exitCode) || exitCode != 0) - var/fuck_up_reason = "DIDN'T READ" - if(fexists("fuck_up.txt")) - fuck_up_reason = "COULDN'T READ" - fuck_up_reason = file2text("fuck_up.txt") - return "Dir check shell command failed with code [exitCode || "null"]: [fuck_up_reason]" - - return "is the most pokemon of all time" - TgsChatBroadcast(new /datum/tgs_message_content("Recieved non-tgs topic: `[T]`")) return "feck" diff --git a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs index bd1671e05e..329fab6aa1 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs @@ -131,8 +131,6 @@ namespace Tgstation.Server.Tests.Live.Instance await RunLongRunningTestThenUpdate(cancellationToken); - await TestDDIsntResolvingSymlink(cancellationToken); - await RunLongRunningTestThenUpdateWithNewDme(cancellationToken); await RunLongRunningTestThenUpdateWithByondVersionSwitch(cancellationToken); @@ -152,70 +150,6 @@ namespace Tgstation.Server.Tests.Live.Instance System.Console.WriteLine($"TEST: END WATCHDOG TESTS {instanceClient.Metadata.Name}"); } - async ValueTask TestDDIsntResolvingSymlink(CancellationToken cancellationToken) - { - System.Console.WriteLine("STARTING SYMLINK RESOLVE TEST"); - var deployTask = DeployTestDme("long_running_test_rooted", DreamDaemonSecurity.Trusted, true, cancellationToken); - - var previous = await instanceClient.DreamDaemon.Read(cancellationToken); - if (previous.SecurityLevel.Value != DreamDaemonSecurity.Trusted) - { - var updated = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest - { - SecurityLevel = DreamDaemonSecurity.Trusted - }, cancellationToken); - - Assert.AreEqual(DreamDaemonSecurity.Trusted, updated.SecurityLevel); - } - - var startState = await deployTask; - - await WaitForJob(await StartDD(cancellationToken), 30, false, null, cancellationToken); - - var command = topicClient.SanitizeString( - Path.GetFullPath( - Path.Combine( - instanceClient.Metadata.Path, - "Game", - "Live"))); - command = $"vaporeon={command}"; - - var topicRequestResult = await topicClient.SendTopic( - IPAddress.Loopback, - command, - ddPort, - cancellationToken); - - Assert.IsNotNull(topicRequestResult); - Assert.AreEqual("is the most pokemon of all time", topicRequestResult.StringData); - - await DeployTestDme("long_running_test_rooted", DreamDaemonSecurity.Trusted, true, cancellationToken); - var newState = await TellWorldToReboot(cancellationToken); - - Assert.AreNotEqual(startState.ActiveCompileJob.Id, newState.ActiveCompileJob.Id); - topicRequestResult = await topicClient.SendTopic( - IPAddress.Loopback, - command, - ddPort, - cancellationToken); - - Assert.IsNotNull(topicRequestResult); - Assert.AreEqual("is the most pokemon of all time", topicRequestResult.StringData); - - await instanceClient.DreamDaemon.Shutdown(cancellationToken); - if (previous.SecurityLevel.Value != DreamDaemonSecurity.Trusted) - { - var updated = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest - { - SecurityLevel = previous.SecurityLevel - }, cancellationToken); - - Assert.AreEqual(previous.SecurityLevel, updated.SecurityLevel); - } - - System.Console.WriteLine("END SYMLINK RESOLVE TEST"); - } - async Task InteropTestsForLongRunningDme(CancellationToken cancellationToken) { await StartAndLeaveRunning(cancellationToken);