South Africans voted on Wednesday in a closely watched local government election, with parties battling for control of major cities in a contest expected to offer a measure of the national mood before the next national polls.