Skip to content

Commit eaa318a

Browse files
authored
Update CI (#561)
1 parent 88fd988 commit eaa318a

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

Diff for: SharpPcap/LibPcap/LibPcapLiveDevice.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public override void Open(DeviceConfiguration configuration)
135135

136136
if (Handle.IsInvalid)
137137
{
138-
var err = $"Unable to open the adapter '{Name}'. {errbuf}";
138+
var err = $"Unable to open the adapter '{Name}' using pcap_create. {errbuf}";
139139
throw new PcapException(err);
140140
}
141141
// Those are configurations that pcap_open can handle differently
@@ -171,20 +171,20 @@ public override void Open(DeviceConfiguration configuration)
171171
(short)mode, // flags
172172
(short)configuration.ReadTimeout, // read timeout
173173
ref auth, // authentication
174-
out errbuf); // error buffer
174+
out errbuf); // error buffer
175175
}
176176
catch (TypeLoadException)
177177
{
178178
var reason = credentials != null ? "Remote PCAP" : "Requested DeviceModes";
179-
var err = $"Unable to open the adapter '{Name}'. {reason} not supported";
179+
var err = $"Unable to open the adapter '{Name}'. {reason} is not supported";
180180
throw new PcapException(err, PcapError.PlatformNotSupported);
181181
}
182-
}
183182

184-
if (Handle.IsInvalid)
185-
{
186-
var err = $"Unable to open the adapter '{Name}'. {errbuf}";
187-
throw new PcapException(err);
183+
if (Handle.IsInvalid)
184+
{
185+
var err = $"Unable to open the adapter '{Name}' using pcap_open. {errbuf}";
186+
throw new PcapException(err);
187+
}
188188
}
189189

190190
ConfigureIfCompatible(use_pcap_create,

Diff for: Test/PcapDeviceTest.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public void NonCompatibleModes()
126126
var ex = Assert.Throws<PcapException>(() => device.Open(config));
127127
if (ex.Error != PcapError.PlatformNotSupported)
128128
{
129-
Assert.That(ex.Message, Does.Contain(nameof(DeviceConfiguration.BufferSize)));
129+
Assert.That(
130+
ex.Message,
131+
Does.Contain(nameof(DeviceConfiguration.BufferSize))
132+
.Or.Contain("using pcap_open")
133+
);
130134
}
131135
}
132136

Diff for: Test/Test.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SPDX-License-Identifier: MIT
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<TargetFrameworks>net8.0</TargetFrameworks>
1212
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net48</TargetFrameworks>
13+
<TestTfmsInParallel>false</TestTfmsInParallel>
1314
<CoverletOutputFormat>opencover</CoverletOutputFormat>
1415
</PropertyGroup>
1516
<ItemGroup>

Diff for: azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pr:
1919
jobs:
2020
- job: linux
2121
pool:
22-
vmImage: ubuntu-20.04
22+
vmImage: ubuntu-24.04
2323
steps:
2424
- script: sudo -E bash scripts/install-libpcap.sh
2525
- script: sudo -E bash scripts/install-tap.sh
@@ -29,7 +29,7 @@ jobs:
2929

3030
- job: macos
3131
pool:
32-
vmImage: macOS-12
32+
vmImage: macOS-14
3333
steps:
3434
- script: sudo -E bash scripts/install-libpcap.sh
3535
- script: sudo sysctl -w net.inet.udp.maxdgram=65535

0 commit comments

Comments
 (0)