def test_port_channel_is_automatically_created_when_adding_a_port_to_it(self, t):
        enable(t)

        t.write("configure terminal")
        t.readln("Enter configuration commands, one per line.  End with CNTL/Z.")
        t.read("my_switch(config)#")
        t.write("interface FastEthernet0/1")
        t.read("my_switch(config-if)#")
        t.write("channel-group 2 mode active")
        t.readln("Creating a port-channel interface Port-channel 2")
        t.read("my_switch(config-if)#")
        t.write("exit")
        t.read("my_switch(config)#")
        t.write("exit")
        t.read("my_switch#")

        assert_interface_configuration(t, 'fa0/1', [
            "interface FastEthernet0/1",
            " channel-group 2 mode active",
            "end"
        ])

        assert_interface_configuration(t, 'po2', [
            "interface Port-channel2",
            "end"
        ])

        t.write("show etherchannel summary")
        t.readln("Flags:  D - down        P - bundled in port-channel")
        t.readln("        I - stand-alone s - suspended")
        t.readln("        H - Hot-standby (LACP only)")
        t.readln("        R - Layer3      S - Layer2")
        t.readln("        U - in use      f - failed to allocate aggregator")
        t.readln("")
        t.readln("        M - not in use, minimum links not met")
        t.readln("        u - unsuitable for bundling")
        t.readln("        w - waiting to be aggregated")
        t.readln("        d - default port")
        t.readln("")
        t.readln("")
        t.readln("Number of channel-groups in use: 1")
        t.readln("Number of aggregators:           1")
        t.readln("")
        t.readln("Group  Port-channel  Protocol    Ports")
        t.readln("------+-------------+-----------+-----------------------------------------------")
        t.readln("2      Po2(SU)         LACP      Fa0/1(P)")
        t.readln("")
        t.read("my_switch#")

        configuring(t, do="no interface port-channel 2")

        configuring_interface(t, interface="fa0/1", do="no channel-group 2 mode on")

        assert_interface_configuration(t, "fa0/1", [
            "interface FastEthernet0/1",
            "end"
        ])