AVR microcontroller test problem
From What you declared in last statement about two codes one with all LED on and other all off, first assume these conditions are true :


Programming is done without any error and verification of data with programmer is valid.
You have tried different MCU with this problem.
Your MCUs are not overheated and consume little current. (I suggest measure current consumption of MCU. It should not be zero or a hundred of mili-ampere.)


Then Problem is about your clocking.Because difference of your two last codes are mainly about before "delay_ms(500)" statement. Then I think problem relate to clocking of your MCU. First of all check frequency of your program by : 

Project->Configure->C-Compiler->Clock frequency. 

and make sure it's 8 in mega-hertz unit.

Now change your MCU fuse-bits to :

LOW : 0xE4

High: 0xD9

Now we expect your code running well!