An unnamed "senior American official" suggests that North Korea is not just testing nukes for itself, but also for (and possibly with) the Iranians. The New York Times reports:
No country is more interested in the results of the North’s nuclear program, or the Western reaction, than Iran, which is pursuing its own uranium enrichment program. The two countries have long cooperated on missile technology, and many intelligence officials believe they share nuclear knowledge as well, though so far there is no hard evidence.
The Iranians are also pursuing uranium enrichment, and one senior American official said two weeks ago that “it’s very possible that the North Koreans are testing for two countries.” Some believe that the country may have been planning two simultaneous tests, but it could take time to sort out the data.