Skip to content
This repository was archived by the owner on Oct 14, 2021. It is now read-only.

Commit 99d247f

Browse files
Upload unit tests (#62)
* Upload Tests. Migrate csproj format. * Remove build warnings Ignore Debug and bin folders * Remove compiler warnings. Set key.snk at Directory.Build.props. * Disable FTP tests when a .runsettings file is not configured. * Setup FTP Server in WSL (Ubuntu) (cherry picked from commit daa962d) Co-authored-by: José Echagüe <jechague@genexus.com>
1 parent 3758a7f commit 99d247f

File tree

199 files changed

+8814
-762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+8814
-762
lines changed

.github/workflows/test.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: .NET
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
env:
14+
LINUX_DISTO: Ubuntu-20.04
15+
FTP_USER: fullgx
16+
FTP_PASS: fullgx
17+
TRUST_STORE_PASS: fullgx
18+
19+
steps:
20+
- uses: Vampire/setup-wsl@v1
21+
with:
22+
distribution: ${{env.LINUX_DISTO}}
23+
additional-packages:
24+
vsftpd
25+
26+
- name: Setup user
27+
shell: wsl-bash {0}
28+
run: |
29+
sudo useradd -m -p $(perl -e 'print crypt($ARGV[0], "password")' '${{env.FTP_PASS}}') ${{env.FTP_USER}}
30+
echo ${{env.FTP_USER}} >> /etc/vsftpd.userlist
31+
32+
- name: Setup SSH
33+
shell: wsl-bash {0}
34+
run: |
35+
sudo apt-get -qq -y purge openssh-server
36+
sudo apt-get -qq -y install openssh-server
37+
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
38+
sudo service ssh --full-restart
39+
40+
- uses: Vampire/setup-wsl@v1
41+
with:
42+
distribution: ${{env.LINUX_DISTO}}
43+
wsl-shell-command: bash -c "sudo -u ${{env.FTP_USER}} bash --noprofile --norc -euo pipefail '{0}'"
44+
45+
- name: Setup certificates
46+
shell: wsl-bash {0}
47+
run: |
48+
ssh-keygen -b 2048 -t rsa -m pem -f ~/.ssh/id_rsa -q -N ""
49+
ssh-keygen -f ~/.ssh/id_rsa -m pem -e > /tmp/id_rsa.pem
50+
51+
cat ~/.ssh/id_rsa > /tmp/vsftpd1.pem
52+
cat /tmp/id_rsa.pem >> /tmp/vsftpd1.pem
53+
54+
openssl req -new -x509 -key ~/.ssh/id_rsa -days 365 -subj "/CN=GeneXus" -out /tmp/ftp.cer
55+
openssl pkcs12 -export -in /tmp/ftp.cer -inkey ~/.ssh/id_rsa -out /tmp/ftp_cert.pfx -password pass:${{env.TRUST_STORE_PASS}}
56+
57+
ssh-keyscan -H 127.0.0.1 >> /tmp/known_hosts
58+
59+
echo '::set-output name=BASE_64_ID_RSA::$(cat ~/.ssh/id_rsa | base64)'
60+
echo '::set-output name=BASE_64_PFX_CERT::$(cat /tmp/ftp_cert.pfx | base64)'
61+
echo '::set-output name=BASE_64_KNOWN_HOSTS::$(cat /tmp/known_hosts | base64)'
62+
63+
- uses: Vampire/setup-wsl@v1
64+
with:
65+
distribution: ${{env.LINUX_DISTO}}
66+
wsl-shell-command: bash -c "bash --noprofile --norc -euo pipefail '{0}'"
67+
68+
- name: Configure vsftpd
69+
shell: wsl-bash {0}
70+
run: |
71+
mv /tmp/vsftpd1.pem /etc/ssl/private/vsftpd1.pem
72+
mkdir -p /etc/vsftpd/
73+
74+
cat <<EOF > /etc/vsftpd/vsftpd.conf
75+
listen=NO
76+
listen_ipv6=YES
77+
anonymous_enable=NO
78+
local_enable=YES
79+
write_enable=YES
80+
local_umask=022
81+
dirmessage_enable=YES
82+
use_localtime=YES
83+
xferlog_enable=YES
84+
connect_from_port_20=YES
85+
chroot_local_user=YES
86+
secure_chroot_dir=/var/run/vsftpd/empty
87+
pam_service_name=ftp
88+
pasv_enable=Yes
89+
pasv_min_port=10000
90+
pasv_max_port=11000
91+
user_sub_token=$USER
92+
local_root=/home/$USER/ftp
93+
userlist_enable=YES
94+
userlist_file=/etc/vsftpd.userlist
95+
userlist_deny=NO
96+
rsa_cert_file=/etc/ssl/private/vsftpd1.pem
97+
rsa_private_key_file=/etc/ssl/private/vsftpd1.pem
98+
ssl_enable=YES
99+
allow_anon_ssl=NO
100+
force_local_data_ssl=YES
101+
force_local_logins_ssl=YES
102+
ssl_tlsv1=YES
103+
ssl_sslv2=YES
104+
ssl_sslv3=YES
105+
require_ssl_reuse=NO
106+
debug_ssl=YES
107+
ssl_ciphers=HIGH
108+
seccomp_sandbox=NO
109+
isolate_network=NO
110+
EOF
111+
112+
sudo /etc/init.d/vsftpd start
113+
114+
- uses: actions/checkout@v2
115+
116+
- name: Setup .NET
117+
uses: actions/setup-dotnet@v1
118+
with:
119+
dotnet-version: 5.0.x
120+
121+
- name: Restore dependencies
122+
run: dotnet restore
123+
- name: Build
124+
run: dotnet build --no-restore

.gitignore

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.vs/
22
packages/
3-
test/
43
dotnet/dotnetframework/SecurityAPICommons/bin/
54
dotnet/dotnetframework/SecurityAPICommons/obj/
65
dotnet/dotnetframework/GeneXusXmlSignature/obj/
@@ -26,40 +25,19 @@ dotnet/dotnetcore/GeneXusJWTNetCore/obj/
2625
dotnet/dotnetcore/GeneXusJWTNetCore/bin/
2726
dotnet/dotnetcore/GeneXusCryptographyNetCore/obj/
2827
dotnet/dotnetcore/GeneXusCryptographyNetCore/bin/
29-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.cache
30-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.dgspec.json
31-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.g.props
32-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.g.targets
33-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.assets.json
34-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfo.cs
35-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfoInputs.cache
36-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.assets.cache
37-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csproj.CopyComplete
38-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csproj.FileListAbsolute.txt
39-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csprojAssemblyReference.cache
40-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll
41-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb
42-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfo.cs
43-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfoInputs.cache
44-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.assets.cache
45-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csproj.CopyComplete
46-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csproj.FileListAbsolute.txt
47-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csprojAssemblyReference.cache
48-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll
49-
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb
50-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.deps.json
51-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll
52-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb
53-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.dll
54-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.pdb
55-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.deps.json
56-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll
57-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb
58-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.dll
59-
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.pdb
28+
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/
29+
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/
6030
dotnet/dotnetframework/GeneXusFtps/obj/
6131
dotnet/dotnetframework/GeneXusFtps/bin/
6232
dotnet/dotnetframework/GeneXusFtps/packages.config
6333
dotnet/dotnetcore/GeneXusFtpsNetCore/obj/
6434
dotnet/resources/key.snk
6535
dotnet/dotnetcore/GeneXusFtpsNetCore/bin/
36+
/test/dotnetcore/SecurityAPITestNetCore/.runsettings
37+
/test/dotnetframework/SecurityAPITest/.runsettings
38+
/test/dotnetframework/SecurityAPITest/obj/
39+
/test/dotnetframework/SecurityAPITest/bin/
40+
/test/dotnetcore/SecurityAPITestNetCore/bin/
41+
/test/dotnetcore/SecurityAPITestNetCore/obj/
42+
/test/resources/key.snk
43+
/test/.runsettings

SecurityAPIParent.sln

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{5CB172
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetframework", "dotnetframework", "{5EA71E19-9448-4F49-B24A-A5BF8964C54D}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityAPICommons", "dotnet\dotnetframework\SecurityAPICommons\SecurityAPICommons.csproj", "{BE9A040C-DE9A-490A-B02C-9E1D97B30B21}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPICommons", "dotnet\dotnetframework\SecurityAPICommons\SecurityAPICommons.csproj", "{BE9A040C-DE9A-490A-B02C-9E1D97B30B21}"
1111
EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetcore", "dotnetcore", "{2B1F2BC4-723C-46F6-8C23-3FB82AF975E9}"
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPICommonsNetCore", "dotnet\dotnetcore\SecurityAPICommonsNetCore\SecurityAPICommonsNetCore.csproj", "{A3C5EE4E-A9AA-408F-AE26-9E28154D1C39}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusCryptography", "dotnet\dotnetframework\GeneXusCryptography\GeneXusCryptography.csproj", "{420F7E79-1CC3-4FA6-8399-7C07B2EE94DE}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusCryptography", "dotnet\dotnetframework\GeneXusCryptography\GeneXusCryptography.csproj", "{420F7E79-1CC3-4FA6-8399-7C07B2EE94DE}"
1717
EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusCryptographyNetCore", "dotnet\dotnetcore\GeneXusCryptographyNetCore\GeneXusCryptographyNetCore.csproj", "{4E759B82-D093-43E4-BF34-923025AED531}"
1919
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusXmlSignature", "dotnet\dotnetframework\GeneXusXmlSignature\GeneXusXmlSignature.csproj", "{291B2556-49D9-4775-823F-FCE5E2416C0A}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusXmlSignature", "dotnet\dotnetframework\GeneXusXmlSignature\GeneXusXmlSignature.csproj", "{291B2556-49D9-4775-823F-FCE5E2416C0A}"
2121
EndProject
2222
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusXmlSignatureNetCore", "dotnet\dotnetcore\GeneXusXmlSignatureNetCore\GeneXusXmlSignatureNetCore.csproj", "{503D8578-4455-4DC0-ADDC-37E4C886427B}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusJWT", "dotnet\dotnetframework\GeneXusJWT\GeneXusJWT.csproj", "{1D9FF129-BE37-4316-BFF3-9BEACC4612CB}"
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusJWT", "dotnet\dotnetframework\GeneXusJWT\GeneXusJWT.csproj", "{1D9FF129-BE37-4316-BFF3-9BEACC4612CB}"
2525
EndProject
2626
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusJWTNetCore", "dotnet\dotnetcore\GeneXusJWTNetCore\GeneXusJWTNetCore.csproj", "{09DD9A8C-C6E8-47B2-BF68-D85BF5E6FC36}"
2727
EndProject
28-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusSftp", "dotnet\dotnetframework\GeneXusSftp\GeneXusSftp.csproj", "{7F864DEC-0EE0-420D-9976-9C7E39398161}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusSftp", "dotnet\dotnetframework\GeneXusSftp\GeneXusSftp.csproj", "{7F864DEC-0EE0-420D-9976-9C7E39398161}"
2929
EndProject
3030
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusSftpNetCore", "dotnet\dotnetcore\GeneXusSftpNetCore\GeneXusSftpNetCore.csproj", "{1C8B841E-28A7-4D6B-95BE-47D2DDE1FE35}"
3131
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusFtps", "dotnet\dotnetframework\GeneXusFtps\GeneXusFtps.csproj", "{76AD359D-960B-418D-8A1C-004E0E2D325C}"
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusFtps", "dotnet\dotnetframework\GeneXusFtps\GeneXusFtps.csproj", "{76AD359D-960B-418D-8A1C-004E0E2D325C}"
3333
EndProject
3434
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusFtpsNetCore", "dotnet\dotnetcore\GeneXusFtpsNetCore\GeneXusFtpsNetCore.csproj", "{06054CD3-91A7-4A0A-AA5C-A70B64CF4755}"
3535
EndProject
@@ -39,16 +39,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetcore", "dotnetcore",
3939
EndProject
4040
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetframework", "dotnetframework", "{7F5F1DDC-09BE-4567-8CD4-41387AD91BEE}"
4141
EndProject
42-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityAPITest", "test\dotnetframework\SecurityAPITest\SecurityAPITest.csproj", "{9100025A-68E0-4618-B83C-4D626CB89DBB}"
43-
EndProject
44-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITestNetCore", "test\dotnetcore\SecurityAPITestNetCore\SecurityAPITestNetCore.csproj", "{44B8B2B6-0842-4018-A547-EF33920EFC8E}"
42+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITest", "test\dotnetframework\SecurityAPITest\SecurityAPITest.csproj", "{9100025A-68E0-4618-B83C-4D626CB89DBB}"
4543
EndProject
4644
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{88EB1BC4-0D68-4906-AA36-E1EA1F6AFD35}"
4745
ProjectSection(SolutionItems) = preProject
48-
dotnet\resources\key.snk = dotnet\resources\key.snk
4946
dotnet\resources\Neon.SSH.NET.dll = dotnet\resources\Neon.SSH.NET.dll
5047
EndProjectSection
5148
EndProject
49+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITestNetCore", "test\dotnetcore\SecurityAPITestNetCore\SecurityAPITestNetCore.csproj", "{27D2471A-DA98-4912-A327-AF135550B034}"
50+
EndProject
5251
Global
5352
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5453
Debug|Any CPU = Debug|Any CPU
@@ -107,10 +106,10 @@ Global
107106
{9100025A-68E0-4618-B83C-4D626CB89DBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
108107
{9100025A-68E0-4618-B83C-4D626CB89DBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
109108
{9100025A-68E0-4618-B83C-4D626CB89DBB}.Release|Any CPU.Build.0 = Release|Any CPU
110-
{44B8B2B6-0842-4018-A547-EF33920EFC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
111-
{44B8B2B6-0842-4018-A547-EF33920EFC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
112-
{44B8B2B6-0842-4018-A547-EF33920EFC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
113-
{44B8B2B6-0842-4018-A547-EF33920EFC8E}.Release|Any CPU.Build.0 = Release|Any CPU
109+
{27D2471A-DA98-4912-A327-AF135550B034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110+
{27D2471A-DA98-4912-A327-AF135550B034}.Debug|Any CPU.Build.0 = Debug|Any CPU
111+
{27D2471A-DA98-4912-A327-AF135550B034}.Release|Any CPU.ActiveCfg = Release|Any CPU
112+
{27D2471A-DA98-4912-A327-AF135550B034}.Release|Any CPU.Build.0 = Release|Any CPU
114113
EndGlobalSection
115114
GlobalSection(SolutionProperties) = preSolution
116115
HideSolutionNode = FALSE
@@ -133,8 +132,8 @@ Global
133132
{89FFECB3-7A69-41F8-88C7-F05193E5CDF4} = {750343D3-EAA6-433E-A099-71BC6851EA71}
134133
{7F5F1DDC-09BE-4567-8CD4-41387AD91BEE} = {750343D3-EAA6-433E-A099-71BC6851EA71}
135134
{9100025A-68E0-4618-B83C-4D626CB89DBB} = {7F5F1DDC-09BE-4567-8CD4-41387AD91BEE}
136-
{44B8B2B6-0842-4018-A547-EF33920EFC8E} = {89FFECB3-7A69-41F8-88C7-F05193E5CDF4}
137135
{88EB1BC4-0D68-4906-AA36-E1EA1F6AFD35} = {5CB1725B-3FA5-49B1-A1F8-41EFCACA3CF1}
136+
{27D2471A-DA98-4912-A327-AF135550B034} = {89FFECB3-7A69-41F8-88C7-F05193E5CDF4}
138137
EndGlobalSection
139138
GlobalSection(ExtensibilityGlobals) = postSolution
140139
SolutionGuid = {AEB1693D-906F-402A-AD66-A1A9AE2ABBE2}

0 commit comments

Comments
 (0)