NewLife/Stardust

net8应用测试表现跟NewLife应用一致
大石头 authored at 2024-05-16 18:41:35
0ff7f5e
Tree
1 Parent(s) 7600bf7
Summary: 2 changed files with 93 additions and 3 deletions.
Modified +76 -3
Added +17 -0
Modified +76 -3
diff --git a/Doc/ProcessStart.md b/Doc/ProcessStart.md
index 77b6318..e1d2b11 100644
--- a/Doc/ProcessStart.md
+++ b/Doc/ProcessStart.md
@@ -12,9 +12,13 @@ A应用通过Process类启动B应用,研究不同参数设置下的测试结
 
 星尘代理:/root/agent
 
-A目录:/root/TestA
+A目录:/root/TestA  主程序
 
-B目录:/root/TestB
+B目录:/root/TestB  目标NewLife应用
+
+C目录:/root/TestC  目标net8应用
+
+D目录:/root/TestD  目标非托管应用
 
 跟随退出:随着A应用退出,B应用跟随退出
 
@@ -124,11 +128,80 @@ centos执行命令的目录:/root
 
 #### Net8应用测试
 
-要求B应用是普通net8应用,禁止引入NewLife.Core。
+要求C应用是普通net8应用,禁止引入NewLife.Core。
+
+win10执行命令的目录:D:\X\Stardust\Bin\Samples
+
+centos执行命令的目录:/root
+
+| 系统/参数             | Shell | WorkingDirectory | Environment     | 合并输出 | 跟随退出 | 结果CurrentDirectory |
+| --------------------- | :---: | ---------------- | --------------- | :------: | :------: | -------------------- |
+| win10                 | false |                  |                 |    Y     |    N     | \Samples             |
+| TestA.exe -c -b -e    | false |                  | star=dust       |    Y     |    N     | \Samples             |
+| TestA.exe -c -w       | false | \Samples\TestC   |                 |    Y     |    N     | \Samples\TestC       |
+| TestA.exe -c -w -b -e | false | \Samples\TestC   | BasePath=xxx    |    Y     |    N     | \Samples\TestC       |
+| TestA.exe -c -s       | true  |                  |                 |    N     |    N     | \Samples             |
+| TestA.exe -c -s -b -e | true  |                  | 要求shell=false |          |          | ==报错==             |
+| TestA.exe -c -s -w    | true  | \Samples\TestC   |                 |    N     |    N     | \Samples\TestC       |
+| TestA.exe -c -s -w -b | true  | \Samples\TestC   | BasePath=xxx    |    N     |    N     | \Samples\TestC       |
+| CentOS7.9             | false |                  |                 |    Y     |    N     | /root                |
+| TestA -c -b -e        | false |                  | star=dust       |    Y     |    N     | /root                |
+| TestA -c -w           | false | /root/TestC      |                 |    Y     |    N     | /root/TestC          |
+| TestA -c -w -b -e     | false | /root/TestC      | BasePath=xxx    |    Y     |    N     | /root/TestC          |
+| TestA -c -s           | true  |                  |                 |    Y     |    N     | /root                |
+| TestA -c -s -b -e     | true  |                  | BasePath=xxx    |    Y     |    N     | /root                |
+| TestA -c -s -w        | true  | /root/TestC      |                 |    Y     |    N     | /root/TestC          |
+| TestA -c -s -w -b -e  | true  | /root/TestC      | BasePath=xxx    |    Y     |    N     | /root/TestC          |
 
+测试结论:
 
+1. net8应用测试表现跟NewLife应用一致
+
+2. 目标C应用的当前目录,取决于WorkingDirectory,如果未设置则取A应用的当前目录(非A工作目录)
+
+3. windows上UseShellExecute=true时,目标C应用输出不会合并到A窗口,而是独立窗口
+
+4. 所有测试用例,C都不会跟随A退出。(该结论跟星尘代理现状不一致,后者会跟随退出)
+
+5. 进程的Environment环境变量,在windows下要求UseShellExecute=false,Linux下则无此要求
+
+   
 
 #### 非托管应用测试
 
 要求B应用必须是非托管应用。
 
+win10执行命令的目录:D:\X\Stardust\Bin\Samples
+
+centos执行命令的目录:/root
+
+| 系统/参数             | Shell | WorkingDirectory | Environment     | 合并输出 | 跟随退出 | 结果CurrentDirectory |
+| --------------------- | :---: | ---------------- | --------------- | :------: | :------: | -------------------- |
+| win10                 | false |                  |                 |    Y     |    N     | \Samples             |
+| TestA.exe -d -b -e    | false |                  | star=dust       |    Y     |    N     | \Samples             |
+| TestA.exe -d -w       | false | \Samples\TestD   |                 |    Y     |    N     | \Samples\TestD       |
+| TestA.exe -d -w -b -e | false | \Samples\TestD   | BasePath=xxx    |    Y     |    N     | \Samples\TestD       |
+| TestA.exe -d -s       | true  |                  |                 |    N     |    N     | \Samples             |
+| TestA.exe -d -s -b -e | true  |                  | 要求shell=false |          |          | ==报错==             |
+| TestA.exe -d -s -w    | true  | \Samples\TestD   |                 |    N     |    N     | \Samples\TestD       |
+| TestA.exe -d -s -w -b | true  | \Samples\TestD   | BasePath=xxx    |    N     |    N     | \Samples\TestD       |
+| CentOS7.9             | false |                  |                 |    Y     |    N     | /root                |
+| TestA -d -b -e        | false |                  | star=dust       |    Y     |    N     | /root                |
+| TestA -d -w           | false | /root/TestD      |                 |    Y     |    N     | /root/TestD          |
+| TestA -d -w -b -e     | false | /root/TestD      | BasePath=xxx    |    Y     |    N     | /root/TestD          |
+| TestA -d -s           | true  |                  |                 |    Y     |    N     | /root                |
+| TestA -d -s -b -e     | true  |                  | BasePath=xxx    |    Y     |    N     | /root                |
+| TestA -d -s -w        | true  | /root/TestD      |                 |    Y     |    N     | /root/TestD          |
+| TestA -d -s -w -b -e  | true  | /root/TestD      | BasePath=xxx    |    Y     |    N     | /root/TestD          |
+
+测试结论:
+
+1. 目标B应用的当前目录,取决于WorkingDirectory,如果未设置则取A应用的当前目录(非A工作目录)
+
+2. windows上UseShellExecute=true时,目标B应用输出不会合并到A窗口,而是独立窗口
+
+3. 所有测试用例,B都不会跟随A退出。(该结论跟星尘代理现状不一致,后者会跟随退出)
+
+4. 进程的Environment环境变量,在windows下要求UseShellExecute=false,Linux下则无此要求
+
+   
\ No newline at end of file
Added +17 -0
diff --git a/Samples/TestC/Properties/PublishProfiles/FolderProfile.pubxml b/Samples/TestC/Properties/PublishProfiles/FolderProfile.pubxml
new file mode 100644
index 0000000..c08ab35
--- /dev/null
+++ b/Samples/TestC/Properties/PublishProfiles/FolderProfile.pubxml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+https://go.microsoft.com/fwlink/?LinkID=208121.
+-->
+<Project>
+  <PropertyGroup>
+    <Configuration>Release</Configuration>
+    <Platform>Any CPU</Platform>
+    <PublishDir>..\..\Bin\Samples\TestC\publish\linux-x64\</PublishDir>
+    <PublishProtocol>FileSystem</PublishProtocol>
+    <_TargetId>Folder</_TargetId>
+    <TargetFramework>net8.0</TargetFramework>
+    <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
+    <SelfContained>false</SelfContained>
+    <PublishSingleFile>false</PublishSingleFile>
+  </PropertyGroup>
+</Project>
\ No newline at end of file