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

Initial commit of Google's packetdrill #23679

Closed
wants to merge 2 commits into from
Closed

Conversation

dmjio
Copy link
Member

@dmjio dmjio commented Mar 9, 2017

Motivation for this change

Perform full network stack testing with the nix package manager.

cc @cleverca22

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@dmjio dmjio mentioned this pull request Mar 9, 2017
@@ -0,0 +1,25 @@
{ pkgs ? import <nixpkgs> {} }:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not pass the entire package set; specify inputs as parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

whoops, my bad, will fix.

sha256 = "09sqiakmn63idfjhy2ddf1456sfhi8yhsbp8lxvc1yfjikjxwwbc";
};
setSourceRoot = ''
export sourceRoot=$(realpath */gtests/net/packetdrill)
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tried just sourceRoot = "gtests/net/packetdrill"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have not, but will.

{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation {
version = "1.0";
name = "packetdrill-${version}";
Copy link
Contributor

Choose a reason for hiding this comment

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

The attrset passed to mkDerivation must be rec for values to refer to other attrs in the same set.

Copy link
Member Author

Choose a reason for hiding this comment

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

That was a last minute change. Will fix.

enableParallelBuilding = true;

meta = {
description = "The packetdrill scripting tool enables quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to the NIC hardware";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is too long. Please review the packaging guidelines.

meta = {
description = "The packetdrill scripting tool enables quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to the NIC hardware";
homepage = https://github.com/google/packetdrill;
license = "GPLv2";
Copy link
Contributor

Choose a reason for hiding this comment

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

Use stdenv.lib.licenses

Copy link
Member Author

@dmjio dmjio Mar 10, 2017

Choose a reason for hiding this comment

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

k

nix-repl> stdenv.lib.licenses.gpl2
{ fullName = "GNU General Public License v2.0 only"; shortName = "gpl2"; ...}

description = "The packetdrill scripting tool enables quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to the NIC hardware";
homepage = https://github.com/google/packetdrill;
license = "GPLv2";
platforms = stdenv.lib.platforms.gnu;
Copy link
Contributor

@joachifm joachifm Mar 10, 2017

Choose a reason for hiding this comment

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

Why gnu?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I copied it from telnet :) will fix.

@dmjio
Copy link
Member Author

dmjio commented Mar 10, 2017

@joachifm ready for updated review

@cleverca22
Copy link
Contributor

sourceRoot = "gtests/net/packetdrill" wont work because it needs to start with the directory that unpackPhase made, packetdrill-githash-src

but that githash will change with every update, and the -src at the end can change due to how you fetch the source

using a * will catch whatever it is, and only one directory will contain gtests and match it

@joachifm joachifm closed this in 2151e3b Mar 10, 2017
@joachifm
Copy link
Contributor

Merged. Thank you

@dmjio dmjio deleted the packet-drill branch March 10, 2017 23:36
@dmjio
Copy link
Member Author

dmjio commented Mar 10, 2017

@joachifm cheers 🍻

dmjio added a commit to dmjio/nixpkgs that referenced this pull request Apr 6, 2017
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.

None yet

3 participants