Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split protocol testing into separate ITs for zilla dump command #989

Merged
merged 75 commits into from
May 22, 2024

Conversation

attilakreiner
Copy link
Contributor

@attilakreiner attilakreiner commented Apr 30, 2024

Description

This change splits the zilla dump command testing into separate ITs per protocol, with k3po scripts used to drive the engine and produce the engine frames used to generate the packet capture, then a text-based comparison is used to make diffs more readable should an IT fail.

Fixes #958

@attilakreiner attilakreiner force-pushed the dump-test branch 5 times, most recently from ab250ab to 79d1ecb Compare May 2, 2024 11:52
@attilakreiner attilakreiner changed the title Dump test Split protocol testing into separate ITs for zilla dump command May 6, 2024
@attilakreiner attilakreiner marked this pull request as ready for review May 6, 2024 14:57
Copy link
Contributor

@jfallows jfallows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are getting closer, just the remaining extension types to verify correct via tshark and zilla.lua dissector.

Comment on lines +170 to +171
<exclude>**/keys</exclude>
<exclude>**/trust</exclude>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exclude>**/keys</exclude>
<exclude>**/trust</exclude>
<exclude>src/test/democa/**/*</exclude>

int offset,
int length)
{
boolean shouldWrite = channel.getConfig().hasWriteClosed() || !channel.engine.serverClosed().get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second part of this condition is effectively using a global variable on the engine as a whole which doesn't seem quite right.

What problem were we trying to solve with that? What breaks when it is removed?

Comment on lines 68 to 70
void setWriteClosed(boolean timestamps);

boolean hasWriteClosed();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void setWriteClosed(boolean timestamps);
boolean hasWriteClosed();
void setCloseable(boolean closeable);
boolean isCloseable();

@@ -46,6 +46,7 @@ public final class ZillaTypeSystem implements TypeSystemSpi
public static final TypeInfo<Long> OPTION_AFFINITY = new TypeInfo<>("affinity", Long.class);
public static final TypeInfo<Byte> OPTION_CAPABILITIES = new TypeInfo<>("capabilities", Byte.class);
public static final TypeInfo<String> OPTION_TIMESTAMPS = new TypeInfo<>("timestamps", String.class);
public static final TypeInfo<String> OPTION_WRITE_CLOSED = new TypeInfo<>("writeClosed", String.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final TypeInfo<String> OPTION_WRITE_CLOSED = new TypeInfo<>("writeClosed", String.class);
public static final TypeInfo<String> OPTION_CLOSEABLE = new TypeInfo<>("closeable", String.class);

@@ -95,6 +96,7 @@ public ZillaTypeSystem()
acceptOptions.add(OPTION_ALIGNMENT);
acceptOptions.add(OPTION_CAPABILITIES);
acceptOptions.add(OPTION_TIMESTAMPS);
acceptOptions.add(OPTION_WRITE_CLOSED);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
acceptOptions.add(OPTION_WRITE_CLOSED);
acceptOptions.add(OPTION_CLOSEABLE);

@@ -114,6 +116,7 @@ public ZillaTypeSystem()
connectOptions.add(OPTION_AFFINITY);
connectOptions.add(OPTION_CAPABILITIES);
connectOptions.add(OPTION_TIMESTAMPS);
connectOptions.add(OPTION_WRITE_CLOSED);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connectOptions.add(OPTION_WRITE_CLOSED);
connectOptions.add(OPTION_CLOSEABLE);

Comment on lines 211 to 223
@Override
public void setWriteClosed(
boolean writeClosed)
{
this.writeClosed = writeClosed;
}

@Override
public boolean hasWriteClosed()
{
return writeClosed;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Override
public void setWriteClosed(
boolean writeClosed)
{
this.writeClosed = writeClosed;
}
@Override
public boolean hasWriteClosed()
{
return writeClosed;
}
@Override
public void setCloseable(
boolean closeable)
{
this.closeable = closeable;
}
@Override
public boolean isCloseable()
{
return closeable;
}

Comment on lines 281 to 284
else if (OPTION_WRITE_CLOSED.getName().equals(key))
{
setWriteClosed(Boolean.parseBoolean(Objects.toString(value, "false")));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else if (OPTION_WRITE_CLOSED.getName().equals(key))
{
setWriteClosed(Boolean.parseBoolean(Objects.toString(value, "false")));
}
else if (OPTION_CLOSEABLE.getName().equals(key))
{
setCloseable(Boolean.parseBoolean(Objects.toString(value, "false")));
}


public DefaultZillaChannelConfig()
{
super();
setBufferFactory(NATIVE_BUFFER_FACTORY);
setTimestamps(true);
setWriteClosed(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setWriteClosed(true);
setClosable(true);

@@ -51,12 +52,14 @@ public class DefaultZillaChannelConfig extends DefaultChannelConfig implements Z
private long affinity;
private byte capabilities;
private boolean timestamps;
private boolean writeClosed;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private boolean writeClosed;
private boolean closeable;

@jfallows jfallows merged commit 12b8c92 into aklivity:develop May 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split protocol testing into separate ITs for zilla dump command
2 participants