Skip to content

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

Merged
jfallows merged 75 commits into
aklivity:developfrom
attilakreiner:dump-test
May 22, 2024
Merged

Split protocol testing into separate ITs for zilla dump command#989
jfallows merged 75 commits into
aklivity:developfrom
attilakreiner:dump-test

Conversation

@attilakreiner

@attilakreiner attilakreiner commented Apr 30, 2024

Copy link
Copy Markdown
Contributor

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

@jfallows jfallows left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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();

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
Copy Markdown
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);

acceptOptions.add(OPTION_ALIGNMENT);
acceptOptions.add(OPTION_CAPABILITIES);
acceptOptions.add(OPTION_TIMESTAMPS);
acceptOptions.add(OPTION_WRITE_CLOSED);

Copy link
Copy Markdown
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);

connectOptions.add(OPTION_AFFINITY);
connectOptions.add(OPTION_CAPABILITIES);
connectOptions.add(OPTION_TIMESTAMPS);
connectOptions.add(OPTION_WRITE_CLOSED);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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")));
}

super();
setBufferFactory(NATIVE_BUFFER_FACTORY);
setTimestamps(true);
setWriteClosed(true);

Copy link
Copy Markdown
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);

private long affinity;
private byte capabilities;
private boolean timestamps;
private boolean writeClosed;

Copy link
Copy Markdown
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
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