mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
macos test probably should be fixed now
This commit is contained in:
@@ -180,18 +180,26 @@ TEST_F(ZNCTest, ModpythonUnixSocket) {
|
||||
class socktest(znc.Module):
|
||||
def OnLoad(self, args, ret):
|
||||
listen = self.CreateSocket(lis)
|
||||
return listen.Listen(addrtype='unix', path=self.GetSavePath() + "/sock")
|
||||
return listen.Listen(addrtype='unix', path=self.TestSockPath())
|
||||
|
||||
def OnModCommand(self, cmd):
|
||||
sock = self.CreateSocket()
|
||||
sock.ConnectUnix(self.GetSavePath() + "/sock")
|
||||
sock.ConnectUnix(self.TestSockPath())
|
||||
sock.WriteBytes(b'blah')
|
||||
|
||||
def TestSockPath(self):
|
||||
path = self.GetSavePath() + "/sock"
|
||||
# https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars
|
||||
if len(path) < 100:
|
||||
return path
|
||||
return "./testsock.modpython"
|
||||
)");
|
||||
|
||||
auto ircd = ConnectIRCd();
|
||||
auto client = LoginClient();
|
||||
client.Write("znc loadmod modpython");
|
||||
client.Write("znc loadmod socktest");
|
||||
client.ReadUntil("Loaded module socktest");
|
||||
client.Write("PRIVMSG *socktest :foo");
|
||||
client.ReadUntil("received 4 bytes");
|
||||
}
|
||||
@@ -227,14 +235,23 @@ TEST_F(ZNCTest, ModperlUnixSocket) {
|
||||
sub OnLoad {
|
||||
my $self = shift;
|
||||
my $listen = $self->CreateSocket('socktest::lis');
|
||||
$listen->Listen(addrtype=>'unix', path=>$self->GetSavePath . "/sock");
|
||||
$listen->Listen(addrtype=>'unix', path=>$self->TestSockPath);
|
||||
}
|
||||
sub OnModCommand {
|
||||
my ($self, $cmd) = @_;
|
||||
my $sock = $self->CreateSocket('socktest::conn');
|
||||
$sock->ConnectUnix($self->GetSavePath . "/sock");
|
||||
$sock->ConnectUnix($self->TestSockPath);
|
||||
$sock->Write('blah');
|
||||
}
|
||||
sub TestSockPath {
|
||||
my $self = shift;
|
||||
my $path = $self->GetSavePath . "/sock";
|
||||
# https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars
|
||||
if (length($path) < 100) {
|
||||
return $path;
|
||||
}
|
||||
return "./testsock.modperl";
|
||||
}
|
||||
|
||||
1;
|
||||
)");
|
||||
@@ -243,7 +260,7 @@ TEST_F(ZNCTest, ModperlUnixSocket) {
|
||||
auto client = LoginClient();
|
||||
client.Write("znc loadmod modperl");
|
||||
client.Write("znc loadmod socktest");
|
||||
sleep(1);
|
||||
client.ReadUntil("Loaded module socktest");
|
||||
client.Write("PRIVMSG *socktest :foo");
|
||||
client.ReadUntil("received 4 bytes");
|
||||
}
|
||||
|
||||
2
third_party/Csocket
vendored
2
third_party/Csocket
vendored
Submodule third_party/Csocket updated: 13473b0f97...c9fb2e110b
Reference in New Issue
Block a user