From 0ccbf925e02ddb6018aaf524560c470beb8bc433 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 19 Jun 2012 19:06:28 +0200
Subject: [PATCH] Extend burnin to do NIC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This would have caught our previous issue, since QA otherwise doesn't
do add, remove or changes of NICs.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 tools/burnin | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/burnin b/tools/burnin
index fec9a0401..bf93c72e8 100755
--- a/tools/burnin
+++ b/tools/burnin
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -905,17 +905,21 @@ class Burner(object):
 
   @_DoBatch(False)
   def BurnAddRemoveNICs(self):
-    """Add and remove an extra NIC for the instances."""
+    """Add, change and remove an extra NIC for the instances."""
     Log("Adding and removing NICs")
     for instance in self.instances:
       Log("instance %s", instance, indent=1)
       op_add = opcodes.OpInstanceSetParams(\
         instance_name=instance, nics=[(constants.DDM_ADD, {})])
+      op_chg = opcodes.OpInstanceSetParams(\
+        instance_name=instance, nics=[(constants.DDM_MODIFY,
+                                       -1, {"mac": constants.VALUE_GENERATE})])
       op_rem = opcodes.OpInstanceSetParams(\
         instance_name=instance, nics=[(constants.DDM_REMOVE, {})])
       Log("adding a NIC", indent=2)
+      Log("changing a NIC", indent=2)
       Log("removing last NIC", indent=2)
-      self.ExecOrQueue(instance, [op_add, op_rem])
+      self.ExecOrQueue(instance, [op_add, op_chg, op_rem])
 
   def ConfdCallback(self, reply):
     """Callback for confd queries"""
-- 
GitLab