torquay 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/torquay.rb +8 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8792d5f5749783bc075a296e8f9b855ac06e0e38
4
- data.tar.gz: 8839bac7410282179ad22118d32c31447438eb71
3
+ metadata.gz: 88709e9d278d916435dd21de4ba2dba36dd64dfc
4
+ data.tar.gz: 66835f365af3b213b40afae5f8e3943ca3d48163
5
5
  SHA512:
6
- metadata.gz: e303f7fe464fe991586776cb816bebdd73bc4a2636999d70c4f63b4f942223c44dfc995c23a191cb87b02f5f53fdd13df2e498636e9f352a4dfdfbe4a94b9fc8
7
- data.tar.gz: 5b25a6c3275314392661f5b2d08016a8f338ddc95358677596f84551108cbb93567a1f05194697def7c843e6e72849cbe64cc291f83c1e820b20d8f3c86f5597
6
+ metadata.gz: 5806129c18409028c8b4dea666a89a399055e4580a0fb492e76fad0ae4236ea4824653026c8753c3c4024399f1c639b6c5c046a972371732124a7236860e3ccd
7
+ data.tar.gz: 2929e3f8971ef2dda8b50ad170d75ccf313ec13e49c82ad2cd8bd70e826b431a1519bc5baf6e0a1429d3b1c95fc5c29b0b8cc89f062bdc0d52e9562220c27f86
@@ -41,6 +41,14 @@ class Torquay
41
41
  @host[:ports] = @container.json["NetworkSettings"]["Ports"]
42
42
  end
43
43
 
44
+ def set_network_delay(ms)
45
+ @container.exec(['tc', 'qdisc', 'add', 'dev', 'eth0', 'root', 'netem', 'delay', '#{ms}ms'])
46
+ end
47
+
48
+ def remove_network_delay
49
+ @container.exec(['tc', 'qdisc', 'del', 'dev', 'eth0', 'root', 'netem'])
50
+ end
51
+
44
52
  def cleanup
45
53
  if @container
46
54
  @container.stop
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torquay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tal Levy