Home | History | Annotate | Download | only in Domains
      1 # -*-coding:utf-8 -*
      2 
      3 # Copyright (c) 2011-2015, Intel Corporation
      4 # All rights reserved.
      5 #
      6 # Redistribution and use in source and binary forms, with or without modification,
      7 # are permitted provided that the following conditions are met:
      8 #
      9 # 1. Redistributions of source code must retain the above copyright notice, this
     10 # list of conditions and the following disclaimer.
     11 #
     12 # 2. Redistributions in binary form must reproduce the above copyright notice,
     13 # this list of conditions and the following disclaimer in the documentation and/or
     14 # other materials provided with the distribution.
     15 #
     16 # 3. Neither the name of the copyright holder nor the names of its contributors
     17 # may be used to endorse or promote products derived from this software without
     18 # specific prior written permission.
     19 #
     20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     23 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
     24 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     25 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     26 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
     27 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     29 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30 
     31 """
     32 Creation, renaming and deletion configuration testcases
     33 
     34 List of tested functions :
     35 --------------------------
     36     - [listConfigurations]  function
     37     - [createConfiguration] function
     38     - [deleteConfiguration] function
     39     - [renameConfiguration] function
     40 
     41 Test cases :
     42 ------------
     43     - Testing configuration creation error
     44     - Testing configuration renaming error
     45     - Testing configuration deletion error
     46     - Testing nominal case
     47 """
     48 import os
     49 from Util.PfwUnitTestLib import PfwTestCase
     50 from Util import ACTLogging
     51 log=ACTLogging.Logger()
     52 
     53 
     54 # Test of Domains - Rename
     55 class TestCases(PfwTestCase):
     56     def setUp(self):
     57         self.pfw.sendCmd("setTuningMode", "on")
     58         self.domain_name = "domain_test"
     59         self.conf_test = "conf_white"
     60         self.conf_test_renamed = "conf_black"
     61         self.new_conf_number = 5
     62 
     63     def tearDown(self):
     64         self.pfw.sendCmd("setTuningMode", "off")
     65 
     66     def test_Conf_Creation_Error(self):
     67         """
     68         Testing configuration creation error
     69         ------------------------------------
     70             Test case description :
     71             ~~~~~~~~~~~~~~~~~~~~~~~
     72                 - Create an already existent configuration
     73                 - Create a configuration with no name specified
     74                 - Create a configuration on a wrong domain name
     75             Tested commands :
     76             ~~~~~~~~~~~~~~~~~
     77                 - [createConfiguration] function
     78                 - [createDomain] function
     79                 - [listConfigurations] function
     80                 - [deleteConfiguration] function
     81                 - [deleteDomain] function
     82             Expected result :
     83             ~~~~~~~~~~~~~~~~~
     84                 - no configuration created
     85                 - existent configurations not affected by error
     86         """
     87         log.D(self.test_Conf_Creation_Error.__doc__)
     88         # New domain creation for testing purpose
     89         log.I("New domain creation for testing purpose : %s" % (self.domain_name))
     90         log.I("command [createDomain]")
     91         out, err = self.pfw.sendCmd("createDomain",self.domain_name, "")
     92         assert out == "Done", out
     93         assert err == None, "ERROR : command [createDomain] - Error while creating domain %s" % (self.domain_name)
     94         log.I("command [createDomain] correctly executed")
     95         log.I("Domain %s created" % (self.domain_name))
     96 
     97         # New configurations creation for testing purpose
     98         for iteration in range (self.new_conf_number):
     99             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    100             log.I("New configuration %s creation for domain %s" % (new_conf_name,self.domain_name))
    101             log.I("command [createConfiguration]")
    102             out, err = self.pfw.sendCmd("createConfiguration",self.domain_name,new_conf_name)
    103             assert out == "Done", out
    104             assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration %s" % (new_conf_name)
    105             log.I("command [createConfiguration] correctly executed")
    106             log.I("Configuration %s created for domain %s" % (new_conf_name,self.domain_name))
    107 
    108         # Domain configurations listing backup
    109         log.I("Configurations listing for domain %s" % (self.domain_name))
    110         log.I("command [listConfigurations]")
    111         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    112         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    113         log.I("command [listConfigurations] correctly executed")
    114         # Saving configurations names
    115         f_configurations_backup = open("f_configurations_backup", "w")
    116         f_configurations_backup.write(out)
    117         f_configurations_backup.close()
    118 
    119         # New configurations creation error
    120         log.I("Creating an already existent configurations names")
    121         for iteration in range (self.new_conf_number):
    122             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    123             log.I("Trying to create already existent %s configuration for domain %s" % (new_conf_name,self.domain_name))
    124             log.I("command [createConfiguration]")
    125             out, err = self.pfw.sendCmd("createConfiguration",self.domain_name,new_conf_name)
    126             assert out != "Done", "ERROR : command [createConfiguration] - Error not detected while creating already existent configuration %s" % (new_conf_name)
    127             assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration %s" % (new_conf_name)
    128             log.I("command [createConfiguration] correctly executed")
    129             log.I("error correctly detected, no configuration created")
    130         log.I("Creating a configuration without specifying a name")
    131         out, err = self.pfw.sendCmd("createConfiguration",self.domain_name)
    132         assert out != "Done", "ERROR : command [createConfiguration] - Error not detected while creating a configuration without specifying a name"
    133         assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration"
    134         log.I("error correctly detected")
    135         log.I("Creating a configuration on a wrong domain name")
    136         new_conf_name = "new_conf"
    137         out, err = self.pfw.sendCmd("createConfiguration","wrong_domain_name",new_conf_name)
    138         assert out != "Done", "ERROR : command [createConfiguration] - Error not detected while creating a configuration on a wrong domain name"
    139         assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration"
    140         log.I("error correctly detected")
    141 
    142         # New domain configurations listing
    143         log.I("Configurations listing for domain %s" % (self.domain_name))
    144         log.I("command [listConfigurations]" )
    145         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    146         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    147         log.I("command [listConfigurations] correctly executed")
    148         # Saving configurations names
    149         f_configurations = open("f_configurations", "w")
    150         f_configurations.write(out)
    151         f_configurations.close()
    152 
    153         # Checking configurations names integrity
    154         log.I("Configurations listing conformity check")
    155         f_configurations = open("f_configurations", "r")
    156         f_configurations_backup = open("f_configurations_backup", "r")
    157         for iteration in range(self.new_conf_number):
    158             listed_conf_backup = f_configurations_backup.readline().strip('\n')
    159             listed_conf = f_configurations.readline().strip('\n')
    160             assert listed_conf==listed_conf_backup, "ERROR : Error while listing configuration %s (found %s)" % (listed_conf_backup, listed_conf)
    161         log.I("No change detected, listed configurations names conform to expected values")
    162 
    163         # New domain deletion
    164         log.I("End of test, new domain deletion")
    165         log.I("command [deleteDomain]")
    166         out, err = self.pfw.sendCmd("deleteDomain",self.domain_name, "")
    167         assert out == "Done", "ERROR : %s" % (out)
    168         assert err == None, "ERROR : command [deleteDomain] - Error while deleting domain %s" % (self.domain_name)
    169         log.I("command [deleteDomain] correctly executed")
    170 
    171         # Closing and deleting temp files
    172         f_configurations_backup.close()
    173         os.remove("f_configurations_backup")
    174         f_configurations.close()
    175         os.remove("f_configurations")
    176 
    177     def test_Conf_Renaming_Error(self):
    178         """
    179         Testing configuration renaming error
    180         ------------------------------------
    181             Test case description :
    182             ~~~~~~~~~~~~~~~~~~~~~~~
    183                 - Rename a configuration with an already used name
    184                 - Rename a configuration with no name specified
    185                 - Rename a configuration on a wrong domain name
    186             Tested commands :
    187             ~~~~~~~~~~~~~~~~~
    188                 - [renameConfiguration] function
    189                 - [createDomain] function
    190                 - [listConfigurations] function
    191                 - [createConfiguration] function
    192                 - [deleteConfiguration] function
    193                 - [deleteDomain] function
    194             Expected result :
    195             ~~~~~~~~~~~~~~~~~
    196                 - error detected
    197                 - no configuration created
    198                 - existent configurations not affected by error
    199         """
    200         log.D(self.test_Conf_Renaming_Error.__doc__)
    201         # New domain creation for testing purpose
    202         log.I("New domain creation for testing purpose : %s" % (self.domain_name))
    203         log.I("command [createDomain]")
    204         out, err = self.pfw.sendCmd("createDomain",self.domain_name, "")
    205         assert out == "Done", out
    206         assert err == None, "ERROR : command [createDomain] - Error while creating domain %s" % (self.domain_name)
    207         log.I("command [createDomain] correctly executed")
    208         log.I("Domain %s created" % (self.domain_name))
    209 
    210         # New configurations creation for testing purpose
    211         for iteration in range (self.new_conf_number):
    212             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    213             log.I("New configuration %s creation for domain %s" % (new_conf_name,self.domain_name))
    214             log.I("command [createConfiguration]")
    215             out, err = self.pfw.sendCmd("createConfiguration",self.domain_name,new_conf_name)
    216             assert out == "Done", out
    217             assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration %s" % (new_conf_name)
    218             log.I("command [createConfiguration] correctly executed")
    219             log.I("Configuration %s created for domain %s" % (new_conf_name,self.domain_name))
    220 
    221         # Domain configurations listing backup
    222         log.I("Configurations listing for domain %s" % (self.domain_name))
    223         log.I("command [listConfigurations]")
    224         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    225         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    226         log.I("command [listConfigurations] correctly executed")
    227         # Saving configurations names
    228         f_configurations_backup = open("f_configurations_backup", "w")
    229         f_configurations_backup.write(out)
    230         f_configurations_backup.close()
    231 
    232         # New configurations renaming error
    233         log.I("renaming a configuration with an already used name")
    234         for iteration in range (self.new_conf_number-1):
    235             conf_name = "".join([self.conf_test, "_", str(iteration)])
    236             new_conf_name = "".join([self.conf_test, "_", str(iteration+1)])
    237             log.I("Trying to rename %s on domain %s with an already used name : %s" % (conf_name,self.domain_name,new_conf_name))
    238             log.I("command [renameConfiguration]" )
    239             out, err = self.pfw.sendCmd("renameConfiguration",self.domain_name,conf_name,new_conf_name)
    240             assert out != "Done", "ERROR : command [renameConfiguration] - Error not detected while renaming configuration %s with an already used name" % (new_conf_name)
    241             assert err == None, "ERROR : command [renameConfiguration] - Error while renaming configuration %s" % (new_conf_name)
    242             log.I("command [renameConfiguration] correctly executed")
    243             log.I("error correctly detected, no configuration renamed")
    244         log.I("renaming a configuration without specifying a new name")
    245         out, err = self.pfw.sendCmd("renameConfiguration",self.domain_name,new_conf_name)
    246         assert out != "Done", "ERROR : command [renameConfiguration] - Error not detected while renaming a configuration without specifying a new name"
    247         assert err == None, "ERROR : command [renameConfiguration] - Error while renaming configuration"
    248         log.I("error correctly detected, no configuration renamed")
    249         log.I("renaming a configuration on a wrong domain name")
    250         new_conf_name = "new_conf"
    251         out, err = self.pfw.sendCmd("renameConfiguration","wrong_domain_name",new_conf_name,"Configuration")
    252         assert out != "Done", "ERROR : command [renameConfiguration] - Error not detected while renaming a configuration on a wrong domain name"
    253         assert err == None, "ERROR : command [renameConfiguration] - Error while renaming configuration"
    254         log.I("error correctly detected, no configuration renamed")
    255 
    256         # New domain configurations listing
    257         log.I("Configurations listing for domain %s" % (self.domain_name))
    258         log.I("command [listConfigurations]")
    259         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    260         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    261         log.I("command [listConfigurations] correctly executed")
    262         # Saving configurations names
    263         f_configurations = open("f_configurations", "w")
    264         f_configurations.write(out)
    265         f_configurations.close()
    266 
    267         # Checking configurations names integrity
    268         log.I("Configurations listing conformity check")
    269         f_configurations = open("f_configurations", "r")
    270         f_configurations_backup = open("f_configurations_backup", "r")
    271         for iteration in range(self.new_conf_number):
    272             listed_conf_backup = f_configurations_backup.readline().strip('\n')
    273             listed_conf = f_configurations.readline().strip('\n')
    274             assert listed_conf==listed_conf_backup, "ERROR : Error while listing configuration %s (found %s)" % (listed_conf_backup, listed_conf)
    275         log.I("No change detected, listed configurations names conform to expected values")
    276 
    277         # Testing domain deletion
    278         log.I("End of test, new domain deletion")
    279         log.I("command [deleteDomain]")
    280         out, err = self.pfw.sendCmd("deleteDomain",self.domain_name, "")
    281         assert out == "Done", "ERROR : %s" % (out)
    282         assert err == None, "ERROR : command [deleteDomain] - Error while deleting domain %s" % (self.domain_name)
    283         log.I("command [deleteDomain] correctly executed")
    284 
    285         # Closing and deleting temp files
    286         f_configurations_backup.close()
    287         os.remove("f_configurations_backup")
    288         f_configurations.close()
    289         os.remove("f_configurations")
    290 
    291     def test_Conf_Deletion_Error(self):
    292         """
    293         Testing configuration deletion error
    294         ------------------------------------
    295             Test case description :
    296             ~~~~~~~~~~~~~~~~~~~~~~~
    297                 - Delete a configuration with a non existent name
    298                 - Delete a configuration with no name specified
    299                 - Delete a configuration on a wrong domain name
    300             Tested commands :
    301             ~~~~~~~~~~~~~~~~~
    302                 - [deleteConfiguration] function
    303                 - [createDomain] function
    304                 - [listConfigurations] function
    305                 - [createConfiguration] function
    306                 - [deleteDomain] function
    307             Expected result :
    308             ~~~~~~~~~~~~~~~~~
    309                 - error detected
    310                 - no configuration created
    311                 - existent configurations not affected by error
    312         """
    313         print self.test_Conf_Renaming_Error.__doc__
    314         # New domain creation for testing purpose
    315         log.I("New domain creation for testing purpose : %s" % (self.domain_name))
    316         log.I("command [createDomain]")
    317         out, err = self.pfw.sendCmd("createDomain",self.domain_name, "")
    318         assert out == "Done", out
    319         assert err == None, "ERROR : command [createDomain] - Error while creating domain %s" % (self.domain_name)
    320         log.I("command [createDomain] correctly executed")
    321         log.I("Domain %s created" % (self.domain_name))
    322 
    323         # New configurations creation for testing purpose
    324         for iteration in range (self.new_conf_number):
    325             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    326             log.I("New configuration %s creation for domain %s" % (new_conf_name,self.domain_name))
    327             log.I("command [createConfiguration]")
    328             out, err = self.pfw.sendCmd("createConfiguration",self.domain_name,new_conf_name)
    329             assert out == "Done", out
    330             assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration %s" % (new_conf_name)
    331             log.I("command [createConfiguration] correctly executed")
    332             log.I("Configuration %s created for domain %s" % (new_conf_name,self.domain_name))
    333 
    334         # Domain configurations listing backup
    335         log.I("Configurations listing for domain %s" % (self.domain_name))
    336         log.I("command [listConfigurations]")
    337         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    338         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    339         log.I("command [listConfigurations] correctly executed")
    340         # Saving configurations names
    341         f_configurations_backup = open("f_configurations_backup", "w")
    342         f_configurations_backup.write(out)
    343         f_configurations_backup.close()
    344 
    345         # Configurations deletion errors
    346         log.I("Trying various deletions error test cases")
    347         log.I("Trying to delete a wrong configuration name on domain %s" % (self.domain_name))
    348         log.I("command [deleteConfiguration]")
    349         out, err = self.pfw.sendCmd("deleteConfiguration",self.domain_name,"wrong_configuration_name")
    350         assert out != "Done", "ERROR : command [deleteConfiguration] - Error not detected while deleting non existent configuration name"
    351         assert err == None, "ERROR : command [deleteConfiguration] - Error while deleting configuration"
    352         log.I("command [deleteConfiguration] correctly executed")
    353         log.I("error correctly detected, no configuration deleted")
    354         log.I("deleting a configuration with no name specified")
    355         out, err = self.pfw.sendCmd("deleteConfiguration",self.domain_name)
    356         assert out != "Done", "ERROR : command [deleteConfiguration] - Error not detected while deleting a configuration without specifying a name"
    357         assert err == None, "ERROR : command [deleteConfiguration] - Error while deleting configuration"
    358         log.I("error correctly detected, no configuration deleted")
    359         log.I("deleting a configuration on a wrong domain name")
    360         out, err = self.pfw.sendCmd("deleteConfiguration","wrong_domain_name",new_conf_name)
    361         assert out != "Done", "ERROR : command [deleteConfiguration] - Error not detected while deleting a configuration on a wrong domain name"
    362         assert err == None, "ERROR : command [deleteConfiguration] - Error while deleting configuration"
    363         log.I("error correctly detected, no configuration deleted")
    364 
    365         # New domain configurations listing
    366         log.I("Configurations listing for domain %s" % (self.domain_name))
    367         log.I("command [listConfigurations]")
    368         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    369         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    370         log.I("command [listConfigurations] correctly executed")
    371         # Saving configurations names
    372         f_configurations = open("f_configurations", "w")
    373         f_configurations.write(out)
    374         f_configurations.close()
    375 
    376         # Checking configurations names integrity
    377         log.I("Configurations listing conformity check")
    378         f_configurations = open("f_configurations", "r")
    379         f_configurations_backup = open("f_configurations_backup", "r")
    380         for iteration in range(self.new_conf_number):
    381             listed_conf_backup = f_configurations_backup.readline().strip('\n')
    382             listed_conf = f_configurations.readline().strip('\n')
    383             assert listed_conf==listed_conf_backup, "ERROR : Error while listing configuration %s (found %s)" % (listed_conf_backup, listed_conf)
    384         log.I("No change detected, listed configurations names conform to expected values")
    385 
    386         # Testing domain deletion
    387         log.I("End of test, new domain deletion")
    388         log.I("command [deleteDomain]")
    389         out, err = self.pfw.sendCmd("deleteDomain",self.domain_name, "")
    390         assert out == "Done", "ERROR : %s" % (out)
    391         assert err == None, "ERROR : command [deleteDomain] - Error while deleting domain %s" % (self.domain_name)
    392         log.I("command [deleteDomain] correctly executed")
    393 
    394         # Closing and deleting temp files
    395         f_configurations_backup.close()
    396         os.remove("f_configurations_backup")
    397         f_configurations.close()
    398         os.remove("f_configurations")
    399 
    400     def test_Nominal_Case(self):
    401         """
    402         Testing nominal cases
    403         ---------------------
    404             Test case description :
    405             ~~~~~~~~~~~~~~~~~~~~~~~
    406                 - Create new configurations
    407                 - List domain configurations
    408                 - Rename configurations
    409                 - Delete configurations
    410             Tested commands :
    411             ~~~~~~~~~~~~~~~~~
    412                 - [listConfigurations] function
    413                 - [createConfiguration] function
    414                 - [renameConfiguration] function
    415                 - [deleteConfiguration] function
    416                 - [createDomain] function
    417                 - [deleteDomain] function
    418             Expected result :
    419             ~~~~~~~~~~~~~~~~~
    420                 - all operations succeed
    421         """
    422         log.D(self.test_Nominal_Case.__doc__)
    423         # New domain creation
    424         log.I("New domain creation for testing purpose : %s" % (self.domain_name))
    425         log.I("command [createDomain]")
    426         out, err = self.pfw.sendCmd("createDomain",self.domain_name, "")
    427         assert out == "Done", out
    428         assert err == None, "ERROR : command [createDomain] - Error while creating domain %s" % (self.domain_name)
    429         log.I("command [createDomain] correctly executed")
    430         log.I("Domain %s created" % (self.domain_name))
    431 
    432         # New configurations creation
    433         for iteration in range (self.new_conf_number):
    434             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    435             log.I("New configuration %s creation for domain %s" % (new_conf_name,self.domain_name))
    436             log.I("command [createConfiguration]" )
    437             out, err = self.pfw.sendCmd("createConfiguration",self.domain_name,new_conf_name)
    438             assert out == "Done", out
    439             assert err == None, "ERROR : command [createConfiguration] - Error while creating configuration %s" % (new_conf_name)
    440             log.I("command [createConfiguration] correctly executed")
    441             log.I("Configuration %s created for domain %s" % (new_conf_name,self.domain_name))
    442 
    443         # Listing domain configurations
    444         log.I("Configurations listing for domain %s" % (self.domain_name))
    445         log.I("command [listConfigurations]")
    446         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    447         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    448         log.I("command [listConfigurations] correctly executed")
    449         # Saving configurations names
    450         f_configurations = open("f_configurations", "w")
    451         f_configurations.write(out)
    452         f_configurations.close()
    453         # Checking configurations names integrity
    454         log.I("Configurations listing conformity check")
    455         f_configurations = open("f_configurations", "r")
    456         for iteration in range(self.new_conf_number):
    457             new_conf_name = "".join([self.conf_test, "_", str(iteration)])
    458             listed_conf = f_configurations.readline().strip('\n')
    459             assert listed_conf==new_conf_name, "ERROR : Error while listing configuration %s (found %s)" % (listed_conf, new_conf_name)
    460         log.I("Listed configurations names conform to expected values")
    461 
    462         # Configuration renaming
    463         log.I("Configurations renaming")
    464         for iteration in range (self.new_conf_number):
    465             conf_name = "".join([self.conf_test, "_", str(iteration)])
    466             new_conf_name = "".join([self.conf_test_renamed, "_", str(iteration)])
    467             log.I("Configuration %s renamed to %s in domain %s" % (conf_name,new_conf_name,self.domain_name))
    468             log.I("command [renameConfiguration]")
    469             out, err = self.pfw.sendCmd("renameConfiguration",self.domain_name,conf_name,new_conf_name)
    470             assert out == "Done", out
    471             assert err == None, "ERROR : command [renameConfiguration] - Error while renaming configuration %s to %s" % (conf_name,new_conf_name)
    472             log.I("command [renameConfiguration] correctly executed")
    473             log.I("Configuration %s renamed to %s for domain %s" % (conf_name,new_conf_name,self.domain_name))
    474         # Listing domain configurations
    475         log.I("Configurations listing to check configurations renaming")
    476         log.I("command [listConfigurations]")
    477         out, err = self.pfw.sendCmd("listConfigurations",self.domain_name, "")
    478         assert err == None, "ERROR : command [listConfigurations] - Error while listing configurations for domain %s" % (self.domain_name)
    479         log.I("command [listConfigurations] correctly executed")
    480         # Saving configurations names
    481         f_configurations_renamed = open("f_configurations_renamed", "w")
    482         f_configurations_renamed.write(out)
    483         f_configurations_renamed.close()
    484         # Checking configurations names integrity
    485         log.I("Configurations listing conformity check")
    486         f_configurations_renamed = open("f_configurations_renamed", "r")
    487         for iteration in range(self.new_conf_number):
    488             new_conf_name = "".join([self.conf_test_renamed, "_", str(iteration)])
    489             listed_conf = f_configurations_renamed.readline().strip('\n')
    490             assert listed_conf==new_conf_name, "ERROR : Error while renaming configuration %s (found %s)" % (new_conf_name,listed_conf)
    491         log.I("Listed configurations names conform to expected values, renaming successfull")
    492 
    493         # New domain deletion
    494         log.I("End of test, new domain deletion")
    495         log.I("command [deleteDomain]")
    496         out, err = self.pfw.sendCmd("deleteDomain",self.domain_name, "")
    497         assert out == "Done", "ERROR : %s" % (out)
    498         assert err == None, "ERROR : command [deleteDomain] - Error while deleting domain %s" % (self.domain_name)
    499         log.I("command [deleteDomain] correctly executed")
    500 
    501         # Closing and deleting temp file
    502         f_configurations.close()
    503         os.remove("f_configurations")
    504         f_configurations_renamed.close()
    505         os.remove("f_configurations_renamed")
    506