Skip to content

Commit

Permalink
- fixups and notes for wsl2 (in particular: disable protected mode)
Browse files Browse the repository at this point in the history
- fix some broken sln links
- redisearch ("ft") is now aka "search"
  • Loading branch information
mgravell committed Oct 22, 2020
1 parent 64e5b13 commit 1f7445a
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 3 deletions.
12 changes: 10 additions & 2 deletions StackExchange.Redis.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RedisConfigs", "RedisConfig
tests\RedisConfigs\start-basic.sh = tests\RedisConfigs\start-basic.sh
tests\RedisConfigs\start-cluster.cmd = tests\RedisConfigs\start-cluster.cmd
tests\RedisConfigs\start-sentinel.cmd = tests\RedisConfigs\start-sentinel.cmd
tests\RedisConfigs\wsl2.md = tests\RedisConfigs\wsl2.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchange.Redis", "src\StackExchange.Redis\StackExchange.Redis.csproj", "{EF84877F-59BE-41BE-9013-E765AF0BB72E}"
Expand Down Expand Up @@ -71,8 +72,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basic", "Basic", "{38BDEEED-7BEB-4B1F-9CE0-256D63F9C502}"
ProjectSection(SolutionItems) = preProject
tests\RedisConfigs\Basic\master-6379.conf = tests\RedisConfigs\Basic\master-6379.conf
tests\RedisConfigs\Basic\replica-6380.conf = tests\RedisConfigs\Basic\replica-6380.conf
tests\RedisConfigs\Basic\secure-6381.conf = tests\RedisConfigs\Basic\secure-6381.conf
tests\RedisConfigs\Basic\slave-6380.conf = tests\RedisConfigs\Basic\slave-6380.conf
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTestBaseline", "tests\BasicTestBaseline\BasicTestBaseline.csproj", "{8FDB623D-779B-4A84-BC6B-75106E41D8A4}"
Expand All @@ -82,7 +83,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Failover", "Failover", "{D082703F-1652-4C35-840D-7D377F6B9979}"
ProjectSection(SolutionItems) = preProject
tests\RedisConfigs\Failover\master-6382.conf = tests\RedisConfigs\Failover\master-6382.conf
tests\RedisConfigs\Failover\slave-6383.conf = tests\RedisConfigs\Failover\slave-6383.conf
tests\RedisConfigs\Failover\replica-6383.conf = tests\RedisConfigs\Failover\replica-6383.conf
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchange.Redis.Server", "toys\StackExchange.Redis.Server\StackExchange.Redis.Server.csproj", "{8375813E-FBAF-4DA3-A2C7-E4645B39B931}"
Expand Down Expand Up @@ -134,6 +135,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker", "Docker", "{A9F81D
tests\RedisConfigs\Docker\supervisord.conf = tests\RedisConfigs\Docker\supervisord.conf
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RediSearch", "RediSearch", "{3FA2A7C6-DA16-4DEF-ACE0-34573A4AD430}"
ProjectSection(SolutionItems) = preProject
tests\RedisConfigs\RediSearch\redisearch-6385.conf = tests\RedisConfigs\RediSearch\redisearch-6385.conf
tests\RedisConfigs\RediSearch\redisearch.md = tests\RedisConfigs\RediSearch\redisearch.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -206,6 +213,7 @@ Global
{153A10E4-E668-41AD-9E0F-6785CE7EED66} = {3AD17044-6BFF-4750-9AC2-2CA466375F2A}
{D58114AE-4998-4647-AFCA-9353D20495AE} = {E25031D3-5C64-430D-B86F-697B66816FD8}
{A9F81DA3-DA82-423E-A5DD-B11C37548E06} = {96E891CD-2ED7-4293-A7AB-4C6F5D8D2B05}
{3FA2A7C6-DA16-4DEF-ACE0-34573A4AD430} = {96E891CD-2ED7-4293-A7AB-4C6F5D8D2B05}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {193AA352-6748-47C1-A5FC-C9AA6B5F000B}
Expand Down
2 changes: 1 addition & 1 deletion tests/NRediSearch.Test/RediSearchTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ internal static ConnectionMultiplexer GetWithFT(ITestOutputHelper output)
foreach (var module in arr)
{
var parsed = Parse(module);
if (parsed.TryGetValue("name", out var val) && val == "ft")
if (parsed.TryGetValue("name", out var val) && (val == "ft" || val == "search"))
{
found = true;
if (parsed.TryGetValue("ver", out val))
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Basic/master-6379.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 6379
protected-mode no
repl-diskless-sync yes
repl-diskless-sync-delay 0
databases 2000
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Basic/replica-6380.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 6380
protected-mode no
slaveof 127.0.0.1 6379
repl-diskless-sync yes
repl-diskless-sync-delay 0
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Basic/secure-6381.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 6381
protected-mode no
requirepass changeme
databases 2000
maxmemory 512mb
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7000.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7000
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7000.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7001.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7001
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7001.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7002.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7002
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7002.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7003.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7003
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7003.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7004.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7004
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7004.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Cluster/cluster-7005.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7005
protected-mode no
cluster-enabled yes
dir "../Temp"
cluster-config-file "../Cluster/nodes-7005.conf"
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Failover/master-6382.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 6382
protected-mode no
repl-diskless-sync yes
repl-diskless-sync-delay 0
databases 2000
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Failover/replica-6383.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 6383
protected-mode no
slaveof 127.0.0.1 6382
repl-diskless-sync yes
repl-diskless-sync-delay 0
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Sentinel/redis-7010.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7010
protected-mode no
repl-diskless-sync yes
repl-diskless-sync-delay 0
maxmemory 100mb
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Sentinel/redis-7011.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 7011
protected-mode no
slaveof 127.0.0.1 7010
repl-diskless-sync yes
repl-diskless-sync-delay 0
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Sentinel/sentinel-26379.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 26379
protected-mode no
sentinel monitor mymaster 127.0.0.1 7010 1
sentinel down-after-milliseconds mymaster 1000
sentinel failover-timeout mymaster 1000
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Sentinel/sentinel-26380.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 26380
protected-mode no
sentinel monitor mymaster 127.0.0.1 7010 1
sentinel down-after-milliseconds mymaster 1000
sentinel failover-timeout mymaster 1000
Expand Down
1 change: 1 addition & 0 deletions tests/RedisConfigs/Sentinel/sentinel-26381.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
port 26381
protected-mode no
sentinel monitor mymaster 127.0.0.1 7010 1
sentinel down-after-milliseconds mymaster 1000
sentinel failover-timeout mymaster 1000
Expand Down
23 changes: 23 additions & 0 deletions tests/RedisConfigs/wsl2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
If you're using WSL2, then the WSL2 instance is now a full VM with a separate IP address rather than being part of the current machine;
this means that you may need to use:

``` txt
~$ ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
```

to get the server's address, and update the entries in `TestConfig.json`, for example if the IP address is `172.17.168.110`:

``` json
{
"MasterServer": "172.17.168.110",
"ReplicaServer": "172.17.168.110",
"SecureServer": "172.17.168.110",
"FailoverMasterServer": "172.17.168.110",
"FailoverReplicaServer": "172.17.168.110",
"RediSearchServer": "172.17.168.110",
"RemoteServer": "172.17.168.110",
"SentinelServer": "172.17.168.110",
"ClusterServer": "172.17.168.110",
"IPv4Server": "172.17.168.110"
}
```

0 comments on commit 1f7445a

Please sign in to comment.